OR-Tools  9.6
RoutingSolution

Detailed Description

Definition at line 52 of file solution_serializer.h.

Classes

struct  Event
 

Public Types

using Route = std::vector< Event >
 

Public Member Functions

 RoutingSolution (std::vector< Route > routes, std::vector< int64_t > total_demands, std::vector< int64_t > total_distances, int64_t total_cost=-1, int64_t total_distance=-1, double total_time=-1.0, std::string_view name="")
 
bool operator== (const RoutingSolution &other) const
 
bool operator!= (const RoutingSolution &other) const
 
void SetTotalTime (double total_time)
 
void SetTotalCost (int64_t total_cost)
 
void SetTotalDistance (int64_t total_distance)
 
void SetName (std::string_view name)
 
void SetAuthors (std::string_view authors)
 
std::string SerializeToString (RoutingOutputFormat format) const
 
std::string SerializeToSolutionFile (RoutingOutputFormat format) const
 
void WriteToSolutionFile (RoutingOutputFormat format, const std::string &file_name) const
 

Static Public Member Functions

static std::vector< std::vector< int64_t > > SplitRoutes (const std::vector< int64_t > &solution, int64_t separator)
 
static RoutingSolution FromSplitRoutes (const std::vector< std::vector< int64_t >> &routes, std::optional< int64_t > depot=std::nullopt)
 

Member Typedef Documentation

◆ Route

using Route = std::vector<Event>

Definition at line 97 of file solution_serializer.h.

Constructor & Destructor Documentation

◆ RoutingSolution()

RoutingSolution ( std::vector< Route routes,
std::vector< int64_t >  total_demands,
std::vector< int64_t >  total_distances,
int64_t  total_cost = -1,
int64_t  total_distance = -1,
double  total_time = -1.0,
std::string_view  name = "" 
)
inline

Definition at line 99 of file solution_serializer.h.

Member Function Documentation

◆ FromSplitRoutes()

RoutingSolution FromSplitRoutes ( const std::vector< std::vector< int64_t >> &  routes,
std::optional< int64_t >  depot = std::nullopt 
)
static

Definition at line 67 of file solution_serializer.cc.

◆ operator!=()

bool operator!= ( const RoutingSolution other) const
inline

Definition at line 119 of file solution_serializer.h.

◆ operator==()

bool operator== ( const RoutingSolution other) const
inline

Definition at line 114 of file solution_serializer.h.

◆ SerializeToSolutionFile()

std::string SerializeToSolutionFile ( RoutingOutputFormat  format) const
inline

Definition at line 168 of file solution_serializer.h.

◆ SerializeToString()

std::string SerializeToString ( RoutingOutputFormat  format) const
inline

Definition at line 150 of file solution_serializer.h.

◆ SetAuthors()

void SetAuthors ( std::string_view  authors)
inline

Definition at line 130 of file solution_serializer.h.

◆ SetName()

void SetName ( std::string_view  name)
inline

Definition at line 129 of file solution_serializer.h.

◆ SetTotalCost()

void SetTotalCost ( int64_t  total_cost)
inline

Definition at line 125 of file solution_serializer.h.

◆ SetTotalDistance()

void SetTotalDistance ( int64_t  total_distance)
inline

Definition at line 126 of file solution_serializer.h.

◆ SetTotalTime()

void SetTotalTime ( double  total_time)
inline

Definition at line 124 of file solution_serializer.h.

◆ SplitRoutes()

std::vector< std::vector< int64_t > > SplitRoutes ( const std::vector< int64_t > &  solution,
int64_t  separator 
)
static

Definition at line 46 of file solution_serializer.cc.

◆ WriteToSolutionFile()

void WriteToSolutionFile ( RoutingOutputFormat  format,
const std::string &  file_name 
) const

Definition at line 84 of file solution_serializer.cc.


The documentation for this class was generated from the following files: