コード例 #1
0
        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);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
ファイル: EpistemicModel.cs プロジェクト: ashkanalinejad/KLab
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
 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;
 }