示例#1
0
        protected override void PrintAgent()
        {
            base.PrintAgent();

            if (!this.LogStatistics)
            {
                return;
            }

            var emotionalQuantityList = new StatisticsCollection
            {
                { CONTROL_STAT_ID, this.testStatisticsAvg[CONTROL_STAT_ID] },
                { VALENCE_STAT_ID, this.testStatisticsAvg[VALENCE_STAT_ID] },
                { GOAL_REL_STAT_ID, this.testStatisticsAvg[GOAL_REL_STAT_ID] },
                { NOVELTY_STAT_ID, this.testStatisticsAvg[NOVELTY_STAT_ID] }
            };

            emotionalQuantityList.PrintAllQuantitiesToCSV(string.Format("{0}/Emotions/DimensionsAvg.csv", this.FilePath));

            //emotionalQuantityList.Clear();
            //foreach (var emotionLabel in this.emotionLabels)
            //    emotionalQuantityList.Add(emotionLabel, this.testStatisticsAvg[emotionLabel));

            //StatisticsUtil.PrintAllQuantitiesToCSV(this.FilePath + "/Emotions/LabelsAvg.csv", emotionalQuantityList);
            //StatisticsUtil.PrintAllQuantitiesCountToXLS(this.FilePath + "/Emotions/LabelsCountAvg.csv",
            //                                     emotionalQuantityList);
        }
示例#2
0
        protected void PrintActionsStatistics()
        {
            //prints action info
            var actionQuantitiesList = new StatisticsCollection();

            actionQuantitiesList.AddRange(this.lastSimulation.Agent.Actions.Keys.ToDictionary(
                                              actionID => actionID,
                                              quantityName => this.testStatisticsAvg[quantityName]));
            actionQuantitiesList.PrintAllQuantitiesToCSV($"{this.FilePath}/Behavior/ActionsAvg.csv");
            actionQuantitiesList.PrintAllQuantitiesToImage($"{this.FilePath}/Behavior/ActionsAvg.png");
        }
示例#3
0
        protected void PrintEmotionDimensions(string filePath)
        {
            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }

            var allDimensions = new StatisticsCollection();

            allDimensions.Add(this.emotionalSTM.Mood.Id, this.emotionalSTM.Mood);
            allDimensions.Add(this.emotionalSTM.Clarity.Id, this.emotionalSTM.Clarity);
            foreach (var dimension in this.emotionalSTM.AppraisalSet.Dimensions.Values)
            {
                allDimensions.Add(dimension.Id, dimension);
            }

            allDimensions.PrintAllQuantitiesToCSV(filePath);
        }
        protected virtual void PrintAgent(uint agentIdx)
        {
            this.WriteLine($@"Printing {agentIdx} statistical quantities...");

            //this.PrintAgentQuantity(agentID, "StateActionValue", "/" + agentID + "/STM/StateActionValueAvg.csv");
            this.PrintAgentQuantity(agentIdx, "Epsilon", $"/{agentIdx}/Learning/EpsilonAvg.csv");
            //this.PrintAgentQuantity(agentID, "PredictionError", "/" + agentID + "/Learning/PredictionErrorAvg.csv");
            //this.PrintAgentQuantity(agentID, "NumBackups", string.Format("/{0}/Learning/NumBackups.csv", agentID));

            var rewardQuantityList =
                new StatisticsCollection
            {
                //{"Reward", this.GetAgentQuantityAverage(agentID, "Reward")},
                { "ExtrinsicReward", this.GetAgentQuantityAverage(agentIdx, "ExtrinsicReward") },
                { "IntrinsicReward", this.GetAgentQuantityAverage(agentIdx, "IntrinsicReward") }
            };

            rewardQuantityList.PrintAllQuantitiesToCSV($"{this.FilePath}/{agentIdx}/STM/RewardAvg.csv");
        }
示例#5
0
        protected override void PrintAgent()
        {
            base.PrintAgent();

            if (!this.LogStatistics)
            {
                return;
            }

            this.PrintStatistic("NumBackups", "/Learning/NumBackupsAvg.csv");

            var rewardQuantityList = new StatisticsCollection
            {
                //{"Reward", this.GetAgentQuantityAverage("Reward")},
                { "ExtrinsicReward", this.testStatisticsAvg["ExtrinsicReward"] },
                { "IntrinsicReward", this.testStatisticsAvg["IntrinsicReward"] }
            };

            rewardQuantityList.PrintAllQuantitiesToCSV(this.FilePath + "/STM/RewardAvg.csv");
        }
        protected override void PrintPerformanceResults()
        {
            //prints agents' cumulative fitness
            this.WriteLine(@"Printing agents' performances...");

            if (this.TestsConfig.StoreIndividualAgentStats)
            {
                var agentsFitnessList = new StatisticsCollection();
                for (uint i = 0; i < this.TestsConfig.NumAgents; i++)
                {
                    agentsFitnessList.Add($"Agent{i}",
                                          this.testStatisticsAvg[this.GetAgentFitnessStatID(i)]);
                }

                agentsFitnessList.PrintAllQuantitiesToCSV($"{this.FilePath}/AgentsCumulativeFitnessAvg.csv");
                //agentsFitnessList.PrintAllQuantitiesToImage($"{this.FilePath}/AgentsCumulativeFitnessAvg.png");
            }

            //prints overall cumulative fitness
            this.SimulationScoreAvg.PrintStatisticsToCSV($"{this.FilePath}/CumulativeFitnessAvg.csv");
            this.FinalScores.PrintStatisticsToCSV($"{this.FilePath}/CumulativeFitnessValues.csv", false, true, ChartType.Column);
        }