private void SetUp(SymuEnvironment environment, MainOrganization organization) { Engine.SetEnvironment(environment); SetUpOrganization(); Engine.Environment.SetOrganization(organization); //Intentionally after SetOrganization because Scenarii are Agents SetUpScenarii(); }
/// <summary> /// </summary> /// <param name="environment"></param> /// <param name="organization"></param> protected void Start(SymuEnvironment environment, MainOrganization organization) { if (environment is null) { throw new ArgumentNullException(nameof(environment)); } Engine.State = AgentState.Starting; SetUp(environment, organization); PreProcess(); if (backgroundWorker1.IsBusy != true) // Start the asynchronous operation. { backgroundWorker1.RunWorkerAsync(); } }
//public void AddEvent(EventEntity eventEntity) //{ // if (eventEntity == null) // { // throw new ArgumentNullException(nameof(eventEntity)); // } // Organization.MetaNetwork.Event.Add(eventEntity); //} #endregion #region Start and Stop /// <summary> /// Once this method is called followed by InitializeIteration (via Initialize or Process methods) /// You have to use Environment.Organization instead of your organization /// </summary> /// <param name="organization"></param> public virtual void SetOrganization(MainOrganization organization) { MainOrganizationReference = organization ?? throw new ArgumentNullException(nameof(organization)); }