public AssossiativeSet <Agent> GetTagedAgentOfTransitionBetween(EpisState a, EpisState b) { EpisTransitionPair key = new EpisTransitionPair(a, b); key = TransitionRelation.Find(x => x.Equals(key)); if (key == null) { return(null); } return(key.TagedAgents); }
public void CopyFrom(ModelConfiguration modelConfiguration) { Name = modelConfiguration.Name; EpisState[] StateArray = new EpisState[modelConfiguration.States.Count]; EpisTransitionPair[] TransArray = new EpisTransitionPair[modelConfiguration.TransitionRelation.Count]; modelConfiguration.States.CopyTo(StateArray); modelConfiguration.TransitionRelation.CopyTo(TransArray); States = StateArray.ToList(); TransitionRelation = TransArray.ToList(); }
private void AddTransition(EpisState a, EpisState b, AssossiativeSet <Agent> tags, bool unionTagsIfAlreadyAPair) { EpisTransitionPair newPair = new EpisTransitionPair(a, b) { TagedAgents = tags }; EpisTransitionPair availablePair = TransitionRelation.Find(x => x.Equals(newPair)); if (availablePair == null) { TransitionRelation.Add(newPair); } else { if (unionTagsIfAlreadyAPair) { availablePair.TagedAgents.Union(tags); } } }
public ModelConfiguration GeneratRawModelConfiguration(string name) { ModelConfiguration modelConfiguration = new ModelConfiguration(name); int stateCount = (int)Math.Pow(2, _atomics.Count); bool[] positivity = InitializeSingleValueArray(_atomics.Count, false); for (int i = 0; i < stateCount; i++) { EpisState toAdd = new EpisState(_atomics.Values.ToArray(), positivity); modelConfiguration.AddState(toAdd); IncreamentBinarySeq(ref positivity); } foreach (var s1 in modelConfiguration.States) { foreach (var s2 in modelConfiguration.States) { EpisTransitionPair trans = new EpisTransitionPair(s1, s2); trans.TagedAgents = new AssossiativeSet <Agent>(_agents.Values); modelConfiguration.TransitionRelation.Add(trans); } } return(modelConfiguration); }
private void AddTransition(EpisState a, EpisState b, AssossiativeSet<Agent> tags , bool unionTagsIfAlreadyAPair) { EpisTransitionPair newPair = new EpisTransitionPair(a,b) {TagedAgents = tags}; EpisTransitionPair availablePair = TransitionRelation.Find(x => x.Equals(newPair)); if (availablePair==null) { TransitionRelation.Add(newPair); } else { if (unionTagsIfAlreadyAPair) availablePair.TagedAgents.Union(tags); } }
public AssossiativeSet<Agent> GetTagedAgentOfTransitionBetween(EpisState a, EpisState b) { EpisTransitionPair key = new EpisTransitionPair(a,b); key = TransitionRelation.Find(x => x.Equals(key)); if (key == null) return null; return key.TagedAgents; }