Пример #1
0
        public SimulationModel1(ISpaceTemplateFactory spaceDefinition, TPlugin plugin, string pluginName, SimulationModelConfiguration modelConfiguration)
        {
            Plugin = plugin;
            var spaceTemplate = spaceDefinition.CreateSpaceTemplate();
            var cardinalSpace = new CardinalMovementSpace <TAgent>(spaceTemplate, modelConfiguration.AgentsCollisionModel);

            Space = new DestructibleInteractiveSpace <CardinalMovementSpace <TAgent>, TAgent>(cardinalSpace);
            Goals = new RandomRenewableGoals <TAgent>(Space.InteractiveSpace, modelConfiguration.CreateRandom());
            spaceTemplate.AgentMap.ForEachTrue(CreateAgent);
            Results = new SimulationResults(pluginName, spaceDefinition.Name);
            Results.Series.Add("Reached Goals", Goals.ReachedGoals);
            Results.Series.Add("Collisions", Space.Collisions);
            Results.Series.Add("ConsumedTime", ConsumedTime);
            ModelConfiguration = modelConfiguration;
        }
Пример #2
0
 public void Add(SimulationResults item)
 {
     item.Description.Length = item.Series.Values.Select(data => data.Count).Max();
     Descriptions.Add(item.Description);
     GetDataFile(item.Description).Serialize(item.Series);
 }