Esempio n. 1
0
        private void OnStartOfSimulation(object sender, EventArgs e)
        {
            // This needs to happen after all manage pasture activities have been initialised on commencing
            // Therefore we use StartOfSimulation event

            // link to pasture to muster to
            pasture = Activities.GetByName(ManagedPastureName) as PastureActivityManage;

            if (pasture == null)
            {
                Summary.WriteWarning(this, String.Format("Could not find manage pasture activity named \"{0}\" for {1}", ManagedPastureName, this.Name));
                throw new Exception(String.Format("Invalid pasture name ({0}) provided for mustering activity {1}", ManagedPastureName, this.Name));
            }

            if (PerformAtStartOfSimulation)
            {
                Muster();
            }
        }
Esempio n. 2
0
        private void OnStartOfSimulation(object sender, EventArgs e)
        {
            // This needs to happen after all manage pasture activities have been initialised on commencing
            // Therefore we use StartOfSimulation event

            // link to pasture to muster to
            pasture = Activities.GetByName(ManagedPastureName) as PastureActivityManage;

            if (pasture == null)
            {
                Summary.WriteWarning(this, String.Format("Could not find manage pasture activity named \"{0}\" for {1}", ManagedPastureName, this.Name));
                throw new Exception(String.Format("Invalid pasture name ({0}) provided for mustering activity {1}", ManagedPastureName, this.Name));
            }

            if (PerformAtStartOfSimulation)
            {
                Muster();
            }
        }