RideDistributor  0.0.1
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
InputData Struct Reference

#include <InputData.hpp>

Public Member Functions

std::string str () const
 

Static Public Member Functions

static std::shared_ptr< InputDatagenFromFile (const std::string path)
 

Public Attributes

unsigned rows
 
unsigned cols
 
unsigned fleetSize
 
unsigned nRides
 
unsigned bonus
 
unsigned maxTime
 
Tensor< int > startX
 
Tensor< int > startY
 
Tensor< int > endX
 
Tensor< int > endY
 
Tensor< int > startT
 
Tensor< int > endT
 
Tensor< int > distances
 

Detailed Description

Represenation of the input file defined by Google-HashCode's problem statement

Attention
When parsing a file no format checks are made which could lead to undefined
behaviour if the file format is invalid.

Member Function Documentation

std::shared_ptr< InputData > InputData::genFromFile ( const std::string  path)
static

Given a valid path to an input file, this method creates a InputData representation of it.

Note
no format checks on the file are performed.
Parameters
[in]pathPath to input file
Exceptions
std::fstream::failureif invalid file/path
Returns
std::shared_ptr<InputData> generated object
std::string InputData::str ( ) const

Returns a string represenation of the input data.

Returns
std::string

Member Data Documentation

unsigned InputData::bonus

Per-ride bonus for starting the ride on time.

unsigned InputData::cols

Number of columns of the grid.

Tensor<int> InputData::distances

Distances of each ride.

Tensor<int> InputData::endT

Latest finishes.

Tensor<int> InputData::endX

Row coordinate of all finish intersections.

Tensor<int> InputData::endY

Column of all finish intersections.

unsigned InputData::fleetSize

Number of vehicles in the fleet.

unsigned InputData::maxTime

Number of steps in the simulation.

unsigned InputData::nRides

Number of rides.

unsigned InputData::rows

Number of rows of the grid.

Tensor<int> InputData::startT

Earliest starts.

Tensor<int> InputData::startX

Row coordinate of all starting intersections.

Tensor<int> InputData::startY

Column coordinate of all starting intersections.


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