コード例 #1
0
 public override void Invoke(int threadID, ZingerPluginState ZPluginState, params object[] Params)
 {
     var par1_MachineStringName = (string)Params[1];
     var par2_StateStringName = (string)Params[2];
     if (!sc.StatesReached.ContainsKey(par1_MachineStringName))
     {
         ConcurrentDictionary<string, bool> temp = new ConcurrentDictionary<string, bool>();
         temp.TryAdd(par2_StateStringName, true);
         sc.StatesReached.TryAdd(par1_MachineStringName, temp);
     }
     else
     {
         ConcurrentDictionary<string, bool> temp;
         var getStateList = sc.StatesReached.TryGetValue(par1_MachineStringName, out temp);
         temp.TryAdd(par2_StateStringName, true);
     }
 }
コード例 #2
0
ファイル: Complan.cs プロジェクト: ZingModelChecker/Zing
 public override void Invoke(int threadID, ZingerPluginState ZPluginState, params object[] Params)
 {
     var functionName = (string)Params[0];
     if (functionName == "GenerateMotionPlan")
     {
         int start = (int)Params[1];
         int end = (int)Params[2];
         throw new ZingerInvokeMotionPlanning(start, end, complanState[threadID].Obstacles);
     }
     else if (functionName == "AddObstacle")
     {
         complanState[threadID].Obstacles.Add((int)Params[1]);
     }
     else if (functionName == "ResetObstacle")
     {
         complanState[threadID].Obstacles = new List<int>();
     }
 }
コード例 #3
0
 public abstract void Invoke(int threadID, ZingerPluginState ZPluginState, params object[] Params);
コード例 #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();
                }
            }
        }