private void Init(DateTime initialTime) { _o2des = null; _initialTime = initialTime; CurrentTime = initialTime; CurrentCount = 0; TotalIncrementCount = 0; TotalDecrementCount = 0; CumValue = 0; }
public HourCounter(O2DES o2des) { Init(o2des.ClockTime); _o2des = o2des; }
static private bool ExecuteHeadEvent_withTimeDilation(O2DES[] simulations) { var toExecute = simulations.Where(s => s.FutureEventList.Count > 0) .OrderBy(s => s.DilatedScheduledTimeForHeadEvent).FirstOrDefault(); if (toExecute != null) { var result = toExecute.ExecuteHeadEvent(); foreach (var s in simulations) if (s != toExecute) s.DilatedClock = toExecute.DilatedClock; //set common clock return result; } return false; }
static public void Run_withTimeDilation(O2DES[] simulations, int eventCount) { while (eventCount > 0 && ExecuteHeadEvent_withTimeDilation(simulations)) eventCount--; }