Skip to content

Commit 76b2d01

Browse files
committed
Bugfix in saveStreet...Counts
1 parent 48812c0 commit 76b2d01

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

src/dsm/dsm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static constexpr uint8_t DSM_VERSION_MAJOR = 2;
88
static constexpr uint8_t DSM_VERSION_MINOR = 3;
9-
static constexpr uint8_t DSM_VERSION_PATCH = 10;
9+
static constexpr uint8_t DSM_VERSION_PATCH = 11;
1010

1111
static auto const DSM_VERSION =
1212
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH);

src/dsm/headers/Dynamics.hpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,15 @@ namespace dsm {
603603
}
604604
file << this->time();
605605
for (auto const& [_, pStreet] : this->m_graph.streetSet()) {
606+
int value{0};
606607
if (pStreet->isSpire()) {
607-
auto& spire = dynamic_cast<SpireStreet&>(*pStreet);
608-
file << ';' << spire.inputCounts(reset);
609-
} else {
610-
file << ';' << 0;
608+
if (pStreet->isStochastic()) {
609+
value = dynamic_cast<StochasticSpireStreet&>(*pStreet).inputCounts(reset);
610+
} else {
611+
value = dynamic_cast<SpireStreet&>(*pStreet).inputCounts(reset);
612+
}
611613
}
614+
file << ';' << value;
612615
}
613616
file << std::endl;
614617
file.close();
@@ -634,12 +637,15 @@ namespace dsm {
634637
}
635638
file << this->time();
636639
for (auto const& [_, pStreet] : this->m_graph.streetSet()) {
640+
int value{0};
637641
if (pStreet->isSpire()) {
638-
auto& spire = dynamic_cast<SpireStreet&>(*pStreet);
639-
file << ';' << spire.outputCounts(reset);
640-
} else {
641-
file << ';' << 0;
642+
if (pStreet->isStochastic()) {
643+
value = dynamic_cast<StochasticSpireStreet&>(*pStreet).outputCounts(reset);
644+
} else {
645+
value = dynamic_cast<SpireStreet&>(*pStreet).outputCounts(reset);
646+
}
642647
}
648+
file << ';' << value;
643649
}
644650
file << std::endl;
645651
file.close();

0 commit comments

Comments
 (0)