Пример #1
0
        /**
         * Create the abstract state space given an indexed hybrid automaton
         */
        private void makeAbstractStateSpace()
        {
            this._S         = this._cha.Locations.Count; // number of discrete locations
            this._r         = 0;                         // number of inter-predicates
            this._T         = 0;
            this._variables = this._cha.Variables;

            if (this.Predicates == null)
            {
                throw new Exception("Error generating abstract state space, no predicates were specified to be used in the abstraction.");
            }

            IEnumerable <Location> query = this._cha.Locations.OrderBy(loc => loc.Value);

            foreach (Location lref in query)
            {
                List <EnvironmentState> es = new List <EnvironmentState>();
                foreach (Location lenv in query)
                {
                    foreach (Expr p in this.Predicates)
                    {
                        EnvironmentState q = new EnvironmentState(lenv.Label, lenv.Value, 0, p);
                        q.VariableRates = lenv.VariableRates; // copy variable rates (for timed transitions)
                        es.Add(q);
                        this._T += 1;
                    }
                }

                // finish enumerating states by adding a copy of es for each control location of the reference process
                this._states.Add(new AbstractState((ConcreteLocation)lref, es));
            }
        }
Пример #2
0
        /**
         * Deep copy
         */
        public override object Clone()
        {
            EnvironmentState eq = new EnvironmentState((String)this.Label.Clone(), this.Value, this.Count.Value, this._predicate);

            eq.VariableRates = this.VariableRates;
            return(eq);
        }
Пример #3
0
 /**
  *
  */
 public void addEnvironmentState(EnvironmentState e)
 {
     if (this._stateEnv == null)
     {
         this._stateEnv = new List <EnvironmentState>();
     }
     this._stateEnv.Add(e);
 }