20 package tutorial.programming.example21tutorialTUBclass.events;
22 import java.util.HashMap;
38 private Map<Id<Person>,Double>
startTimes =
new HashMap<>();
43 public void reset(
int iteration) {
50 this.startTimes.put(event.
getPersonId(),
event.getTime());
57 double workingTime =
event.getTime() - this.startTimes.get(event.
getPersonId());
58 if (workingTime> this.highestWorkDuration)
60 this.highestWorkDuration = workingTime;
61 this.personWithHighestWorkDuration =
event.getPersonId();
67 System.out.println(this.personWithHighestWorkDuration.toString() +
": "+this.
highestWorkDuration);
void handleEvent(ActivityStartEvent event)
double highestWorkDuration
Map< Id< Person >, Double > startTimes
void handleEvent(ActivityEndEvent event)
Id< Person > getPersonId()
Id< Person > personWithHighestWorkDuration
void printPersonWithHighestWorkingTime()
Id< Person > getPersonId()
void reset(int iteration)