Test cases

This commit is contained in:
Gerhard Hoffmann 2024-01-23 10:50:42 +01:00
parent 89b7589600
commit 17ae11212a

View File

@ -54,18 +54,22 @@ int main() {
cout << endl;
if (isParsed) {
QDateTime start = QDateTime::currentDateTime();
start.setTime(QTime(start.time().hour(), start.time().minute(), 0));
Calculator calculator(start);
QList<int> timeSteps = calculator.GetTimeSteps(&cfg);
int minParkingTime = get_minimal_parkingtime(&cfg);
QList<int> timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg);
qCritical() << timeSteps;
int Down = 0;
int Up = 1;
//compute_next_timestep(&cfg, )
for (int i=0; i<timeSteps.size(); ++i) {
uint32_t price = calculator.GetPriceForTimeStep(&cfg, timeSteps.at(i));
uint32_t duration = calculator.GetDurationForPrice(&cfg, price);
qCritical() << "nextTimeStep relative to start:"
<< duration << start.addSecs(duration * 60)
<< "(price so far:" << price << ")";
int nextTimeStep = compute_next_timestep(&cfg, timeSteps.at(i), Up);
qCritical() << "nextTimeStep" << nextTimeStep;
// uint32_t price = calculator.GetPriceForTimeStep(&cfg, timeSteps.at(i));
// uint32_t duration = calculator.GetDurationForPrice(&cfg, price);
// qCritical() << "nextTimeStep relative to start:"
// << duration << start.addSecs(duration * 60)
// << "(price so far:" << price << ")";
}
}
#endif