16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

ai departure logic tweak, minor bug fixes

This commit is contained in:
tmj-fstate
2019-11-07 00:30:00 +01:00
parent a74402804d
commit 71098a7254
5 changed files with 27 additions and 19 deletions

View File

@@ -24,27 +24,19 @@ static char const *hrsd = ".";
struct TMTableLine
{
float km; // kilometraz linii
float vmax; // predkosc rozkladowa przed przystankiem
float km{ 0.f }; // kilometraz linii
float vmax{ -1.f }; // predkosc rozkladowa przed przystankiem
// StationName:string[32]; //nazwa stacji ('_' zamiast spacji)
// StationWare:string[32]; //typ i wyposazenie stacji, oddz. przecinkami}
std::string StationName; // nazwa stacji ('_' zamiast spacji)
std::string StationName{ "nowhere" }; // nazwa stacji ('_' zamiast spacji)
std::string StationWare; // typ i wyposazenie stacji, oddz. przecinkami}
int TrackNo; // ilosc torow szlakowych
int Ah;
float Am; // godz. i min. przyjazdu, -1 gdy bez postoju
int Dh;
float Dm; // godz. i min. odjazdu
float tm; // czas jazdy do tej stacji w min. (z kolumny)
TMTableLine()
{
km = 0;
vmax = -1;
StationName = "nowhere", StationWare = "";
TrackNo = 1;
Ah = Am = Dh = Dm = -1;
tm = 0;
}
int TrackNo{ 1 }; // ilosc torow szlakowych
int Ah{ -1 };
float Am{ -1.f }; // godz. i min. przyjazdu, -1 gdy bez postoju
int Dh{ -1 };
float Dm{ -1.f }; // godz. i min. odjazdu
float tm{ 0.f }; // czas jazdy do tej stacji w min. (z kolumny)
bool is_maintenance{ false };
};
typedef TMTableLine TMTable[MaxTTableSize + 1];
@@ -73,6 +65,7 @@ class TTrainParameters
double WatchMTable(double DistCounter);
std::string NextStop() const;
bool IsStop() const;
bool IsMaintenance() const;
bool IsTimeToGo(double hh, double mm);
bool UpdateMTable(double hh, double mm, std::string const &NewName);
bool UpdateMTable( scenario_time const &Time, std::string const &NewName );