The SimulationWorker class performs simulation work in a separate thread. More...
#include <simulationworker.h>
Public Slots | |
void | onProgressUpdated (int progressPercentage) |
Slot called when the progress is updated. | |
void | onTrainsCoordinatesUpdated (Vector< std::pair< std::string, Vector< std::pair< double, double > > > > trainsStartEndPoints) |
Slot called when the coordinates of trains are updated. | |
void | onSimulationFinished (const Vector< std::pair< std::string, std::string > > &summaryData, const string &trajectoryFile) |
Slot called when the simulation is finished. | |
void | doWork () |
Slot called to start the simulation work. | |
Signals | |
void | simulationFinished (const Vector< std::pair< std::string, std::string > > &summaryData, const std::string &trajectoryFile) |
Signal emitted when the simulation is finished. | |
void | trainsCoordinatesUpdated (Vector< std::pair< std::string, Vector< std::pair< double, double > > > > trainsStartEndPoints) |
Signal emitted when the coordinates of trains are updated. | |
void | simulaionProgressUpdated (int progressPercentage) |
Signal emitted when the simulation progress is updated. | |
void | errorOccurred (std::string error) |
Signal emitted when an error occurs during the simulation. | |
void | trainSuddenAcceleration (std::string msg) |
void | trainSlowSpeed (std::string msg) |
Public Member Functions | |
SimulationWorker (Vector< std::tuple< int, double, double, std::string, double, double > > nodeRecords, Vector< tuple< int, int, int, double, int, double, double, int, double, bool, string, string, double > > linkRecords, Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > trainRecords, std::string networkName, double endTime, double timeStep, double plotFrequency, std::string exportDir, std::string summaryFilename, bool exportInsta, std::string instaFilename, bool exportAllTrainsSummary) | |
Constructs a SimulationWorker object with the specified input data and parameters. | |
~SimulationWorker () | |
Destroys the SimulationWorker object. | |
Public Attributes | |
Simulator * | sim |
< Pointer to the Simulator object for performing the simulation. | |
Network * | net |
The SimulationWorker class performs simulation work in a separate thread.
SimulationWorker::SimulationWorker | ( | Vector< std::tuple< int, double, double, std::string, double, double > > | nodeRecords, |
Vector< tuple< int, int, int, double, int, double, double, int, double, bool, string, string, double > > | linkRecords, | ||
Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > | trainRecords, | ||
std::string | networkName, | ||
double | endTime, | ||
double | timeStep, | ||
double | plotFrequency, | ||
std::string | exportDir, | ||
std::string | summaryFilename, | ||
bool | exportInsta, | ||
std::string | instaFilename, | ||
bool | exportAllTrainsSummary | ||
) |
Constructs a SimulationWorker object with the specified input data and parameters.
nodeRecords | The node records for the simulation. |
linkRecords | The link records for the simulation. |
trainRecords | The train records for the simulation. |
networkName | The network name for the simulation. |
endTime | The end time for the simulation. |
timeStep | The time step for the simulation. |
plotFrequency | The plot frequency for the simulation. |
exportDir | The export directory for the simulation. |
summaryFilename | The summary filename for the simulation. |
exportInsta | Indicates whether to export instant data in the simulation. |
instaFilename | The instant data filename for the simulation. |
exportAllTrainsSummary | Indicates whether to export summary data for all trains in the simulation. |
SimulationWorker::~SimulationWorker | ( | ) |
Destroys the SimulationWorker object.
|
slot |
Slot called to start the simulation work.
|
signal |
Signal emitted when an error occurs during the simulation.
error | The error message. |
|
slot |
Slot called when the progress is updated.
progressPercentage | The progress percentage of the simulation. |
|
slot |
Slot called when the simulation is finished.
summaryData | The summary data of the simulation. |
trajectoryFile | The trajectory file path of the simulation. |
|
slot |
Slot called when the coordinates of trains are updated.
trainsStartEndPoints | The start and end points of trains' coordinates. |
|
signal |
Signal emitted when the simulation progress is updated.
progressPercentage | The progress percentage of the simulation. |
|
signal |
Signal emitted when the simulation is finished.
summaryData | The summary data of the simulation. |
trajectoryFile | The trajectory file path of the simulation. |
|
signal |
Signal emitted when the coordinates of trains are updated.
trainsStartEndPoints | The start and end points of trains' coordinates. |
|
signal |
|
signal |
Network* SimulationWorker::net |
Simulator* SimulationWorker::sim |
< Pointer to the Simulator object for performing the simulation.
Pointer to the Network object used in the simulation.