public bool checkIfIterativeCutOffReached(ZingerBounds currBounds)
 {
     if ((currBounds.ExecutionCost > IterativeCutoff) || (ZingerConfiguration.BoundChoices && currBounds.ChoiceCost > FinalChoiceCutOff))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
示例#2
0
 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();
 }
示例#3
0
        public void Deserialize(Stream inputStream)
        {
            BinaryReader bReader = new BinaryReader(inputStream);

            this.Bounds = new ZingerBounds();
            this.Bounds.ExecutionCost = bReader.ReadInt32();
            this.Bounds.ChoiceCost = bReader.ReadInt32();
            if (ZingerConfiguration.DoDelayBounding)
            {
                BinaryFormatter bFormat = new BinaryFormatter();
                bFormat.Binder = new AllowAllAssemblyVersionsDeserializationBinder();
                this.schedulerState = (ZingerSchedulerState)bFormat.Deserialize(inputStream);
            }
            Int32 traceCount = bReader.ReadInt32();
            UInt32[] steps = new UInt32[traceCount];
            for (int i = 0; i < traceCount; i++)
            {
                steps[i] = bReader.ReadUInt32();
            }
            this.TheTrace = new Trace(steps);
        }
示例#4
0
        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();
                }
            }
        }