Example #1
0
        /// <summary>
        ///     Trigger every event before the new step
        ///     Do not send messages, use NextStep for that
        ///     Trigger Agent.PreStep()
        /// </summary>
        public void PreStep()
        {
            var agents = AgentNetwork.AllAgents().ToList();

            SysDynEngine.Process(agents, MainOrganization.ModelNetwork);
            agents.ForEach(a => a.PreStep());
        }
Example #2
0
 /// <summary>
 ///     Initialize model :
 ///     clear Agents and create/Add all agents of the model
 ///     called by Engine.InitializeIteration
 /// </summary>
 public virtual void InitializeIteration()
 {
     AgentNetwork.AgentIndex = 1;
     Messages.Clear();
     //At this point, we must use Environment.Organization.MetaNetwork and not Organization.MetaNetwork
     MainOrganization = MainOrganizationReference.Clone();
     AgentNetwork.Clear();
     IterationResult.Initialize();
     SysDynEngine.Clear();
     SysDynEngine.Initialize();
     SetAgents();
     // Intentionally after SetAgents
     //InitializeInteractionNetwork();
     AgentNetwork.SetStarted();
 }
Example #3
0
 public SymuEnvironment()
 {
     IterationResult = new IterationResult(this);
     SysDynEngine    = new SysDynEngine();
     SysDynEngine.SetSimulation(Fidelity, 1, Schedule.Type);
 }
Example #4
0
 /// <summary>
 ///     Create every agent of the environment in this method
 /// </summary>
 /// <remarks>Call Initialize method after having created an agent</remarks>
 public virtual void SetAgents()
 {
     SysDynEngine.Add(MainOrganization.ModelNetwork);
 }