Added test cases for Szeged.

This commit is contained in:
Gerhard Hoffmann 2024-02-01 13:28:08 +01:00
parent 9d713c894d
commit 631378deeb

View File

@ -37,8 +37,8 @@ extern "C" char* strptime(const char* s,
#define SCHOENAU_KOENIGSEE (0)
#define NEUHAUSER_KORNEUBURG (0)
#define NEUHAUSER_LINSINGER_MASCHINENBAU (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (1)
#define NEUHAUSER_BILEXA_GALTUER (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (1)
int main() {
@ -146,6 +146,7 @@ int main() {
qCritical() << "start=" << start.toString(Qt::ISODate)
<< "end" << end.toString(Qt::ISODate) << "price" << price.netto;
}
for (int offset = 480; offset < 1080; ++offset) {
QDateTime start = s.addSecs(offset * 60);
CalcState cs = compute_price_for_daily_ticket(&cfg, start, end,
@ -184,15 +185,15 @@ int main() {
double cost = Calculator::GetInstance().GetCostFromDuration(&cfg, 4, start, end, marken[duration], nextDay, prePaid);
//qCritical() << "";
//qCritical() << "start" << start.toString(Qt::ISODate)
// << "end" << end.toString(Qt::ISODate)
// << "duration" << marken[duration]
// << "cost" << cost;
std::string d = Calculator::GetInstance().GetDurationFromCost(&cfg, 4, start.toString(Qt::ISODate).toStdString().c_str(), cost);
qCritical() << "start" << start.toString(Qt::ISODate)
<< "cost" << cost
<< "until" << d.c_str() << start.secsTo(QDateTime::fromString(d.c_str(), Qt::ISODate)) / 60;
<< "end" << end.toString(Qt::ISODate)
<< "duration" << marken[duration]
<< "cost" << cost;
//std::string d = Calculator::GetInstance().GetDurationFromCost(&cfg, 4, start.toString(Qt::ISODate).toStdString().c_str(), cost);
//qCritical() << "start" << start.toString(Qt::ISODate)
// << "cost" << cost
// << "until" << d.c_str() << start.secsTo(QDateTime::fromString(d.c_str(), Qt::ISODate)) / 60;
}
}
}
@ -254,7 +255,7 @@ int main() {
int pop_min_price;
int pop_max_price;
for (int t=2; t < 3; ++t) {
for (int t=1; t < 2; ++t) {
//for (int t=6; t < 7; t+=20) {
switch (t) {
case 1: {
@ -301,15 +302,18 @@ int main() {
pop_min_price = get_minimal_parkingprice(&cfg);
pop_max_price = get_maximal_parkingprice(&cfg);
qCritical() << " pop_min_time: " << pop_min_time;
qCritical() << " pop_max_time: " << pop_max_time;
qCritical() << "pop_min_price: " << pop_min_price;
qCritical() << "pop_max_price: " << pop_max_price;
qCritical() << " pop_min_time: " << pop_min_time;
qCritical() << " pop_max_time: " << pop_max_time;
qCritical() << " pop_min_price: " << pop_min_price;
qCritical() << " pop_max_price: " << pop_max_price;
qCritical() << "pop_daily_card_price: " << cfg.getPaymentOptions().pop_daily_card_price;
{
// zone 1 (lila)
QDateTime s(QDate(2023, 11, 30), QTime());
QDateTime end;
int cnt = 1;
#if 0
for (int duration = 15; duration <= pop_max_time; duration += 5) {
for (int offset = 480; offset < 1080; ++offset) {
QDateTime start = s.addSecs(offset * 60);
@ -317,19 +321,34 @@ int main() {
double cost = Calculator::GetInstance().GetCostFromDuration(&cfg, 3, start, end, duration);
// Q_ASSERT(cost == duration*2.5);
qCritical() << "";
qCritical() << "start" << start.toString(Qt::ISODate)
//qCritical() << "";
qCritical() << cnt << "start" << start.toString(Qt::ISODate)
<< "end" << end.toString(Qt::ISODate)
<< "duration" << duration
<< "cost" << cost;
std::string duration = Calculator::GetInstance().GetDurationFromCost(&cfg, 3, start.toString(Qt::ISODate).toStdString().c_str(), cost);
std::string duration = Calculator::GetInstance().GetDurationFromCost(&cfg,
3,
start.toString(Qt::ISODate).toStdString().c_str(),
cost, false, true);
//Q_ASSERT(cost == duration*2.5);
qCritical() << "start" << start.toString(Qt::ISODate)
qCritical() << cnt << "start" << start.toString(Qt::ISODate)
<< "cost" << cost
<< "until" << duration.c_str() << start.secsTo(QDateTime::fromString(duration.c_str(), Qt::ISODate)) / 60;
++cnt;
}
}
#else
QDateTime start = s.addSecs(480 * 60); // 8:00:00
double cost = 2000;
std::string duration = Calculator::GetInstance().GetDurationFromCost(&cfg,
3,
start.toString(Qt::ISODate).toStdString().c_str(),
cost, false, true);
qCritical() << cnt << "start" << start.toString(Qt::ISODate)
<< "cost" << cost
<< "until" << duration.c_str() << start.secsTo(QDateTime::fromString(duration.c_str(), Qt::ISODate)) / 60;
#endif
}
#if 0
{