diff options
| author | Matthijs Bijman <matthijs@bijman.org> | 2017-02-27 15:33:48 +0100 |
|---|---|---|
| committer | Matthijs Bijman <matthijs@bijman.org> | 2017-02-27 15:33:48 +0100 |
| commit | f563b9c9a05b3e47070bfa4775a0e18ace8797a6 (patch) | |
| tree | 479eaec78e76babfeaa99ad7d41e265e2f03d5d3 /Simulator/include/simulation | |
| parent | 34aaaad34e72c921ea72d7b023e5a5270e76dd40 (diff) | |
Experiments are now finished if no machines are present
Diffstat (limited to 'Simulator/include/simulation')
| -rw-r--r-- | Simulator/include/simulation/Experiment.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Simulator/include/simulation/Experiment.h b/Simulator/include/simulation/Experiment.h index 54a861e6..2e77b924 100644 --- a/Simulator/include/simulation/Experiment.h +++ b/Simulator/include/simulation/Experiment.h @@ -32,6 +32,12 @@ namespace Simulation auto machineAccumulator = path.getCurrentSection(currentTick).getMachines(); + if (machineAccumulator.size() == 0) + { + finished = true; + return; + } + // Schedule the workload over each machine scheduler->schedule(machineAccumulator, workloadPool.getWorkloads(currentTick)); @@ -159,7 +165,7 @@ namespace Simulation /** * \brief The number of ticks that have passed. */ - uint32_t currentTick; + uint32_t currentTick = 0; /** * \brief The pool of workloads in this simulation, to be distributed by the scheduler. |
