public ZingPreemptionBounding Clone() { ZingPreemptionBounding cloned = new ZingPreemptionBounding(); cloned.preempted = false; cloned.currentProcess = currentProcess; foreach (var item in restOfEnabledProcesses) { cloned.restOfEnabledProcesses.Add(item); } return cloned; }
public FrontierNode(TraversalInfo ti) { this.Bounds = new ZingerBounds(ti.zBounds.ExecutionCost, ti.zBounds.ChoiceCost); if (ZingerConfiguration.DoDelayBounding) { schedulerState = ti.ZingDBSchedState.Clone(true); } else if (ZingerConfiguration.DoPreemptionBounding) { preemptionBounding = ti.preemptionBounding.Clone(); } ti.IsFingerPrinted = true; TheTrace = ti.GenerateTrace(); }
protected TraversalInfo(StateImpl s, StateType st, TraversalInfo pred, Via bt) { stateType = st; Via = bt; NumProcesses = s.NumProcesses; ProcessInfo = s.GetProcessInfo(); events = s.GetEvents(); exception = s.Exception; IsAcceptingState = s.IsAcceptingState; //initialize the plugin information. if (pred != null) { Predecessor = pred; CurrentDepth = pred.CurrentDepth + 1; zBounds = new ZingerBounds(pred.zBounds.ExecutionCost, pred.zBounds.ChoiceCost); zBounds.IncrementDepthCost(); doDelay = false; if (ZingerConfiguration.DoDelayBounding) { ZingDBSchedState = s.ZingDBSchedState; ZingDBScheduler = s.ZingDBScheduler; } else if (ZingerConfiguration.DoPreemptionBounding) { preemptionBounding = new ZingPreemptionBounding(ProcessInfo, NumProcesses, Predecessor.preemptionBounding.currentProcess); } if (ZingerConfiguration.DronacharyaEnabled || ZingerConfiguration.IsPluginEnabled) { ZingerPlugin = s.ZingerPlugin; ZingerPluginState = s.ZingerPluginState; } pred.Successor = this; MagicBit = pred.MagicBit; } else { zBounds = new ZingerBounds(); MagicBit = false; CurrentDepth = 0; if (ZingerConfiguration.DoDelayBounding) { ZingDBSchedState = s.ZingDBSchedState.Clone(false); ZingDBScheduler = s.ZingDBScheduler; } else if (ZingerConfiguration.DoPreemptionBounding) { preemptionBounding = new ZingPreemptionBounding(ProcessInfo, NumProcesses, 0); } if (ZingerConfiguration.DronacharyaEnabled || ZingerConfiguration.IsPluginEnabled) { ZingerPlugin = s.ZingerPlugin; ZingerPluginState = s.ZingerPluginState.Clone(); } } }