public bool Equals(EAStatePair other) { if (other != null) { return(Right.Equals(other.Right) && Left.Equals(other.Left)); } return(false); }
public bool Equals(EAStatePair other) { if (other != null) { return Right.Equals(other.Right) && Left.Equals(other.Left); } return false; }
public static ModelConfiguration operator *(ModelConfiguration model, ActionModel action) { ModelConfiguration toret = new ModelConfiguration(model.Name + "_" + action.Name); List <EAState> newStates = new List <EAState>(); List <EAStatePair> newTrans = new List <EAStatePair>(); foreach (var aState in action.ActionStates) { foreach (var eState in model.States) { if (eState.SatisfiesFormula(aState.Precondition)) { newStates.Add(new EAState(eState, aState)); } } } foreach (var a in newStates) { foreach (var b in newStates) { AssossiativeSet <Agent> episTaged = model.GetTagedAgentOfTransitionBetween(a.ModelState, b.ModelState); AssossiativeSet <Agent> actionTaged = action.GetTagedAgentOfTransitionBetween(a.ActionState, b.ActionState); AssossiativeSet <Agent> intersection = episTaged.IntersectWith(actionTaged); if (!intersection.IsEmpty) { EAStatePair newTransPair = new EAStatePair(a, b); newTransPair.TagedAgents = intersection; newTrans.Add(newTransPair); toret.AddState(a.ModelState); toret.AddState(b.ModelState); toret.AddTransition(a.ModelState, b.ModelState, intersection, true); } } } return(toret); }