Exemplo n.º 1
0
        private void PrepareTransitionSet(Event e)
        {
            // next state inference ...
            _tset = new TransitionSet();
            _tset.AddRange(e.Triggers
                           .SelectMany(t => t.Transitions)
                           );

            // set of modified variable indexes
            _modified = e.Triggers
                        .SelectMany(t => t.ModifiedVariables)
                        .Distinct()
                        .Select(z => z.Index).ToList();
        }
Exemplo n.º 2
0
        public void CalculateEffects()
        {
            _tset = new TransitionSet();

            // overall precondition for the event
            var c = new TriggerTermCollection<bool>(true);

            foreach (var t in Triggers)
            {
                c.Add(t);

                // add to event wide transition set
                _tset.AddRange(t.Transitions);
            }

            var guards = new GuardCollection();
            var before = new EffectsCollection();
            var after = new EffectsCollection();

            foreach (var t in Triggers)
            {
                foreach (var g in t.Guards)
                {
                    guards.AddGuard(t, g);
                }

                foreach (var effect in t.Effects)
                {
                    after.AddEffect(t, effect);
                }
            }

            guards.AddLeaveEffects(before);
            guards.AddEnterEffects(after);

            // make results visible
            EffectsBefore = before;
            EffectsAfter = after;
            PreCondition = c.PreCondition;
        }
Exemplo n.º 3
0
        private void PrepareTransitionSet(Event e)
        {
            // next state inference ...
            _tset = new TransitionSet();
            _tset.AddRange(e.Triggers
                .SelectMany(t => t.Transitions)
                );

            // set of modified variable indexes
            _modified = e.Triggers
                .SelectMany(t => t.ModifiedVariables)
                .Distinct()
                .Select(z => z.Index).ToList();
        }