11 #include "../utils/SparseMatrix.hpp"
13 #include "Vehicle.hpp"
21 std::vector<std::vector<double>> _nodesCoordinates;
22 std::vector<std::shared_ptr<Street>> _streets;
23 std::vector<std::shared_ptr<Vehicle>> _vehicles;
24 std::vector<int> _vehiclesOnStreet;
26 double _temperature = 0.;
28 double _meanTimeTraveled = 0.;
29 int _nVehiclesToDst = 0;
30 uint16_t _timeScale = 100;
31 std::mt19937 _rng{std::random_device{}()};
33 int _minDistance(
int const,
int const)
38 void _removeVehicles(
bool);
39 int _getTimeDifference(
40 std::shared_ptr<Vehicle>)
const;
41 void _changeStreet(std::shared_ptr<Vehicle>,
44 int _findStreet(
int const,
46 double _getStreetMeanVelocity(
int const)
const;
49 _getDensityCounts(
int const)
const;
51 std::vector<double> _getTravelTimeCounts(
int const)
const;
75 void print(
bool const)
const noexcept;
80 void fprint(
bool const)
const noexcept;
84 std::string
const &)
const noexcept;
85 void fprintHistogram(std::string
const &, std::string
const &,
int const,
86 std::string
const &)
const;
89 std::string
const &)
const;
91 std::string
const &, std::string
const &,
94 std::string
const &)
const;
Graph class.
Definition: Graph.hpp:18
int getTimeScale() const noexcept
get the time scale
Definition: Graph.cpp:316
void printStreets() const noexcept
print streets on terminal with nodes and number of vehicles
Definition: Graph.cpp:481
void addRndmVehicles(int)
add vehicles of random type in _vehicles
Definition: Graph.cpp:332
Graph(std::string)
import from file (only matrix)
Definition: Graph.cpp:251
void fprintDistribution(std::string const &, std::string const &) const
print graphs whit format y \t x
Definition: Graph.cpp:616
void updateTransMatrix()
update the transition matrix
Definition: Graph.cpp:393
void fprint(bool const) const noexcept
print network info on file
Definition: Graph.cpp:499
void fprintStreets(std::string const &) const noexcept
print streets on file with nodes and number of vehicles
Definition: Graph.cpp:512
void setTemperature(double const)
set the temperature of the network
Definition: Graph.cpp:378
double getTemperature() const noexcept
get the system temperature
Definition: Graph.cpp:388
void addVehicle(int)
Adds a vehicle with a given type.
Definition: Graph.cpp:320
void setTimeScale(int const)
set the time scale
Definition: Graph.cpp:306
void setSeed(int const)
set the seed of the random number generator
Definition: Graph.cpp:302
void fprintTimeDistribution(std::string const &, std::string const &, double const) const
print graphs whit format y \t t
Definition: Graph.cpp:664
void printMatrix() noexcept
print adjency matrix on terminal
Definition: Graph.cpp:442
void fprintMatrix(char const *)
print adjency matrix on file
Definition: Graph.cpp:494
void print(bool const) const noexcept
print network info on terminal
Definition: Graph.cpp:444
void addVehiclesUniformly(int)
add vehicles uniformly on the streets
Definition: Graph.cpp:348
void fprintVisual(std::string const &) const noexcept
print file for visual.py
Definition: Graph.cpp:523
void fprintActualState(std::string const &, std::string const &) const
print actual state
Definition: Graph.cpp:705
void fprintHistogram(std::string const &, std::string const &, int const, std::string const &) const
Print some network's data in a elegible format.
Definition: Graph.cpp:551
void evolve()
evolve the network with reinsertion (default)
Definition: Graph.cpp:440