Beispiel #1
0
        /// <summary>
        /// Initializes the extension with a data file.
        /// </summary>
        public override void Initialize()
        {
            reinitialized = false;

            //initialize metadata
            MetadataHandler.InitializeMetadata(parameters.Timestep,
                                               parameters.StatusMapNames,
                                               parameters.MortMapNames,
                                               parameters.LogFileName,
                                               parameters.ManyAgentParameters,
                                               ModelCore);

            //get input params map names
            Timestep      = parameters.Timestep;
            statusMapName = parameters.StatusMapNames;
            mortMapNames  = parameters.MortMapNames;

            //initialize site variables:
            int numAgents = parameters.ManyAgentParameters.Count();

            SiteVars.Initialize(modelCore, numAgents);

            //Dispersal probdisp = new Dispersal();
            manyAgentParameters = parameters.ManyAgentParameters;
            int agentIndex = 0;

            //Initialize non-library climate data
            loadedClimateData = ClimateData.ReadClimateData(manyAgentParameters);

            foreach (IAgent activeAgent in manyAgentParameters)
            {
                if (activeAgent == null)
                {
                    ModelCore.UI.WriteLine("Agent Parameters NOT loading correctly.");
                }

                //read initial infection map and initialize cell status for each agent
                EpidemicRegions.ReadMap(activeAgent.InitEpiMap, agentIndex);
                agentIndex++;

                //initialize and populate dictionary with dispersal probabilities for current agent
                //probdisp.Initialize(activeAgent);
                Dispersal.Initialize(activeAgent);

                //Initialize climate data to calculate historic average for normalization
                ClimateVariableDefinition.CalculateHistoricClimateVariables(activeAgent);
            }
        }
Beispiel #2
0
 public new void InitializePhase2()
 {
     SiteVars.InitializeTimeOfLastDisturbances();
     reinitialized = true;
 }