1 | package de.uka.ipd.sdq.simucomframework; |
2 | |
3 | import de.uka.ipd.sdq.simucomframework.model.SimuComModel; |
4 | import de.uka.ipd.sdq.simulation.abstractsimengine.SimCondition; |
5 | |
6 | public class MaxMeasurementsStopCondition implements SimCondition { |
7 | |
8 | private long max_measurements = 1000; |
9 | private SimuComModel myModel; |
10 | |
11 | public MaxMeasurementsStopCondition(SimuComModel owner) { |
12 | this.myModel = owner; |
13 | max_measurements = myModel.getConfiguration().getMaxMeasurementsCount(); |
14 | } |
15 | |
16 | @Override |
17 | public boolean check() { |
18 | return (max_measurements > 0) && (myModel.getMainMeasurementsCount()>=max_measurements); |
19 | } |
20 | } |