Check paymentOptionIndex for test of GALTUER.

This commit is contained in:
Gerhard Hoffmann 2024-04-24 13:11:28 +02:00
parent 9d72574106
commit 44efd44ede

View File

@ -37,8 +37,8 @@ extern "C" char* strptime(const char* s,
#define SZEGED (0) #define SZEGED (0)
#define SCHOENAU_KOENIGSEE (0) #define SCHOENAU_KOENIGSEE (0)
#define NEUHAUSER_KORNEUBURG (0) #define NEUHAUSER_KORNEUBURG (0)
#define NEUHAUSER_LINSINGER_MASCHINENBAU (0) #define NEUHAUSER_LINSINGER_MASCHINENBAU (1)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (1) #define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (0) #define NEUHAUSER_BILEXA_GALTUER (0)
#define NEUHAUSER_KIRCHDORF (0) #define NEUHAUSER_KIRCHDORF (0)
#define BAD_NEUENAHR_AHRWEILER (0) #define BAD_NEUENAHR_AHRWEILER (0)
@ -1005,7 +1005,7 @@ int main() {
cout << endl; cout << endl;
if (isParsed) { if (isParsed) {
int minParkingTime = get_minimal_parkingtime(&cfg); //int minParkingTime = get_minimal_parkingtime(&cfg);
QList<int> timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg); QList<int> timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg);
qCritical() << timeSteps; qCritical() << timeSteps;
int Down = 0; int Down = 0;
@ -1013,11 +1013,19 @@ int main() {
//compute_next_timestep(&cfg, ) //compute_next_timestep(&cfg, )
QDateTime const start = QDateTime::currentDateTime(); QDateTime const start = QDateTime::currentDateTime();
int paymentOptionIndex = cfg.getPaymentOptionIndex(start);
if (paymentOptionIndex < 0) {
qCritical() << "ERROR paymentOptionIndex" << paymentOptionIndex
<< "< 0 for start" << start.toString(Qt::ISODate);
exit(-1);
}
for (int i=0; i<timeSteps.size(); ++i) { for (int i=0; i<timeSteps.size(); ++i) {
int nextTimeStep = compute_next_timestep(&cfg, timeSteps.at(i), Up); int nextTimeStep = compute_next_timestep(&cfg, timeSteps.at(i), Up);
qCritical() << "nextTimeStep" << nextTimeStep; qCritical() << "nextTimeStep" << nextTimeStep;
uint32_t price = Calculator::GetInstance().GetPriceForTimeStep(&cfg, timeSteps.at(i)); uint32_t price = Calculator::GetInstance().GetPriceForTimeStep(&cfg, timeSteps.at(i), paymentOptionIndex);
uint32_t duration = Calculator::GetInstance().GetDurationForPrice(&cfg, price); uint32_t duration = Calculator::GetInstance().GetDurationForPrice(&cfg, price);
qCritical() << "nextTimeStep relative to start:" qCritical() << "nextTimeStep relative to start:"
<< duration << start.addSecs(duration * 60).toString(Qt::ISODate) << duration << start.addSecs(duration * 60).toString(Qt::ISODate)