Skip to content

Commit 3741647

Browse files
committed
modify elastic solver for diagnostics of max consecutive
1 parent 899d064 commit 3741647

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

src/jres_standard_solver.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,15 @@ JresStandardSolver::CapacityAnalysis JresStandardSolver::calculate_max_potential
119119

120120
std::vector<bool> planned_drive(m_input.stints.size(), false);
121121
int base_capacity = 0;
122-
int current_consecutive = 0;
123-
int maxConsecutive = (p.maxStints > 0) ? p.maxStints : 1;
124-
125122
double driver_total_hours = 0.0;
126123

127124
for(size_t s=0; s<m_input.stints.size(); ++s) {
128125
if (is_available[s]) {
129-
if (current_consecutive < maxConsecutive) {
130-
planned_drive[s] = true;
131-
base_capacity++;
132-
current_consecutive++;
133-
134-
auto duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(endTimes[s] - startTimes[s]).count();
135-
driver_total_hours += static_cast<double>(duration_ms) / 3600000.0;
136-
} else {
137-
current_consecutive = 0; // Forced rest
138-
}
139-
} else {
140-
current_consecutive = 0;
126+
planned_drive[s] = true;
127+
base_capacity++;
128+
129+
auto duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(endTimes[s] - startTimes[s]).count();
130+
driver_total_hours += static_cast<double>(duration_ms) / 3600000.0;
141131
}
142132
}
143133

0 commit comments

Comments
 (0)