Пример #1
0
        private void AddAllTauReachableSteps(ConfigurationBase step, List <EventStepSim> listResutlt)
        {
            NormalizedState NState = NormalizedState.TauReachable(new List <ConfigurationBase>()
            {
                step
            });

            foreach (ConfigurationBase state in NState.States)
            {
                //for each step in this
                IEnumerable <ConfigurationBase> templist = state.MakeOneMove();

                bool hasNonTauEvent = false;
                foreach (ConfigurationBase step1 in templist)
                {
                    if (step1.Event != Common.Classes.Ultility.Constants.TAU)
                    {
                        hasNonTauEvent = true;
                        break;
                    }
                }

                //if the step has non-tau transition, this should be a boundary step, and we need to keep it
                if (hasNonTauEvent || state.IsDeadLock)
                {
                    if (state.Event == Common.Classes.Ultility.Constants.TAU)
                    {
                        //do we need to add the *
                        state.Event       = step.Event; //+ "*"
                        state.DisplayName = null;
                    }

                    EventStepSim step1Sim = new EventStepSim(state);

                    bool contains = false;
                    foreach (EventStepSim sim in listResutlt)
                    {
                        if (sim.Event == step1Sim.Event && sim.StepID == step1Sim.StepID)
                        {
                            contains = true;
                            break;
                        }
                    }

                    //duplicated steps should not be added in.
                    if (!contains)
                    {
                        listResutlt.Add(step1Sim);
                    }
                }
            }
        }
Пример #2
0
        public List <EventStepSim> MakeOneMove(bool HideTauTransition)
        {
            List <EventStepSim>             listResutlt = new List <EventStepSim>();
            IEnumerable <ConfigurationBase> list        = Config.MakeOneMove();

            if (HideTauTransition)
            {
                //for the current moves
                foreach (ConfigurationBase step in list)
                {
                    //if is not tau, means a valid one
                    if (step.Event != Common.Classes.Ultility.Constants.TAU)
                    {
                        //then we find the tau-reachable of this step
                        AddAllTauReachableSteps(step, listResutlt);
                    }
                    //this should be case for initial event
                    else if (Config.Event == Common.Classes.Ultility.Constants.INITIAL_EVENT)
                    {
                        Debug.Assert(Config.Event == Common.Classes.Ultility.Constants.INITIAL_EVENT);

                        NormalizedState NState = NormalizedState.TauReachable(new List <ConfigurationBase>()
                        {
                            step
                        });

                        foreach (ConfigurationBase state in NState.States)
                        {
                            IEnumerable <ConfigurationBase> templist = state.MakeOneMove();

                            foreach (ConfigurationBase step1 in templist)
                            {
                                if (step1.Event != Common.Classes.Ultility.Constants.TAU)
                                {
                                    //then we find the tau-reachable of this step
                                    AddAllTauReachableSteps(step1, listResutlt);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                foreach (ConfigurationBase step in list)
                {
                    bool         contains = false;
                    EventStepSim step1Sim = new EventStepSim(step);
                    foreach (EventStepSim sim in listResutlt)
                    {
                        if (sim.Event == step.Event && sim.StepID == step1Sim.StepID)
                        {
                            contains = true;
                            break;
                        }
                    }

                    //duplicated steps should not be added in.
                    if (!contains)
                    {
                        listResutlt.Add(step1Sim);
                    }
                }
            }

            return(listResutlt);
        }
Пример #3
0
 internal abstract bool IsNormalized(NormalizedState minAllowedState);
Пример #4
0
 internal override bool IsNormalized(NormalizedState minAllowedState)
 {
     return(true);
 }