pwt

Structs

Item

struct Item

Meta data container for items in the grpah.

Public Members

int index

Numeric index.

int profit

ammount

int weight

Weight.

int node_number

node idex

Point

struct Point

Abstraction of a point in xy space.

Public Functions

inline double distance(const Point &other) const

Compute Euclidian distance to other point.

Parameters:

other – Another point

Returns:

double Euclidian distance

Public Members

int x

X Coordinate.

int y

Y Coordinates.

PWTConstraint

struct PWTConstraint : public ioh::problem::Constraint<int>

Graph contraint for pwt.

Public Functions

inline PWTConstraint(const std::shared_ptr<TTPGraph> &graph)

Construct a new PWTConstraint object.

Parameters:

graph – a shared_ptr to some TTPGraph

inline virtual bool compute_violation(const std::vector<int> &x) override

Compute constraint violation.

Parameters:

x – the candidate solution

Returns:

true when there is constraint violation

Returns:

false when there is no constraint violaton

inline virtual double penalty() const override

Penalty function, scales violation.

inline virtual std::string repr() const override

String representation.

Public Members

std::shared_ptr<TTPGraph> graph

pointer to the graph data

TTPData

struct TTPData

TODO: Find out what data is redundant and how we can better map to other graph data TODO: Don’t use stringstream; slow Raw TTP-Graph data container.

Public Functions

inline const std::vector<Item> &items_of(const size_t city) const

The items of a city, without changing city_map (the problems of a graph share it, and may be evaluated from different threads)

Public Members

std::string name

The name.

std::string data_type

The data type.

int dimension

The dimension.

int n_items

The number of items.

int capacity

The capacity.

double min_speed

The min speed.

double max_speed

The max speed.

double rent_ratio

Rent ration.

std::string edge_weight_type

The type weight.

double penalty = 0

numeric constant penalty

double velocity_gap = 0

Veclocity gap.

std::vector<double> distances = {}

Vector of distances.

std::vector<Point> nodes = {}

Vector of nodes (points)

std::vector<Item> items = {}

Vector of items (Item)

std::map<size_t, std::vector<Item>> city_map = {}

Map of index to Item for fast access.

TTPGraph

struct TTPGraph : public ioh::problem::submodular::graph::Graph

Graph data container for pwt.

Public Functions

inline std::string after_colon(const std::string &line) const

Split a string after a colon.

Parameters:

line – the line to split from

Returns:

std::string the thing after the colon

inline virtual void load() override

Load the graph from the static files.

Public Members

TTPData ttp_data

Dataset containing the raw data.