Exemplo n.º 1
0
        /// <summary>
        /// Visits and handles the effect.
        /// </summary>
        /// <param name="effect">Effect.</param>
        public void Visit(ForallEffect effect)
        {
            IEnumerable <ISubstitution> localSubstitutions = GroundingManager.GenerateAllLocalSubstitutions(effect.Parameters);

            foreach (var localSubstitution in localSubstitutions)
            {
                Substitution.AddLocalSubstitution(localSubstitution);
                foreach (var localEffect in effect.Effects)
                {
                    localEffect.Accept(this);
                }
                Substitution.RemoveLocalSubstitution(localSubstitution);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Checks the equality of objects.
        /// </summary>
        /// <param name="obj">Object to be checked.</param>
        /// <returns>True if the objects are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            ForallEffect other = obj as ForallEffect;

            if (other == null)
            {
                return(false);
            }

            return(Parameters.Equals(other.Parameters) &&
                   CollectionsEquality.Equals(Effects, other.Effects));
        }
 /// <summary>
 /// Visits and handles the effect.
 /// </summary>
 /// <param name="effect">Effect.</param>
 public void Visit(ForallEffect effect)
 {
     effect.Effects.ForEach(localEffect => localEffect.Accept(this));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Visits and handles the effect.
 /// </summary>
 /// <param name="effect">Effect.</param>
 public void Visit(ForallEffect effect)
 {
     ForallEffects.Add(effect);
 }