Ejemplo n.º 1
0
        public static void SetCores(Evaluation.Solution temp, Environment env)
        {
            foreach (var cpu in env.Cpus)
            {
                foreach (var core in cpu.Cores)
                {
                    Evaluation.Solution.PE pe = new Evaluation.Solution.PE();
                    pe.CPUID        = cpu.Id;
                    pe.CoreID       = core.Id;
                    pe.Aviliability = core.Availability;


                    List <int> SILs = new List <int>();
                    foreach (var job in core.Tasks)
                    {
                        pe.Task_Names.Add(job.Name);
                        if (!SILs.Contains(job.Cil))
                        {
                            SILs.Add(job.Cil);
                        }
                    }

                    pe.Total_Partitions = SILs.Count;
                    temp.Cores.Add(pe);
                }
            }
        }
Ejemplo n.º 2
0
        public static void SetScores(Evaluation.Solution temp, FitnessScore fitness, Evaluator ev)
        {
            temp.Scores.Total      = fitness.Score;
            temp.Scores.Validity   = fitness.ValidSolution;
            temp.Scores.ValidScore = fitness.MaxValidScore;

            temp.Scores.E2EScore             = fitness.E2EPenalty;
            temp.Scores.E2EViolation         = fitness.E2EViolations;
            temp.Scores.E2EPossibleViolation = fitness.PossibleE2EViolation;

            temp.Scores.DeadlineScore             = fitness.DeadlinePenalty;
            temp.Scores.DeadlineViolation         = fitness.DeadlineViolations;
            temp.Scores.DeadlinePossibleViolation = fitness.PossibleDeadlineViolation;

            temp.Scores.JitterScore             = fitness.JitterPenalty;
            temp.Scores.JitterViolation         = fitness.JitterViolations;
            temp.Scores.JitterPossibleViolation = fitness.PossibleJitterViolation;

            temp.Scores.OrderScore             = fitness.OrderPenalty;
            temp.Scores.OrderViolation         = fitness.OrderViolations;
            temp.Scores.OrderPossibleViolation = fitness.PossibleOrderViolation;
            temp.Scores.QOCScore   = fitness.ControlPenalty;
            temp.Scores.DevControl = fitness.ControlDevPenalty;

            temp.Scores.PartitionScore     = fitness.PartitionPenalty;
            temp.Scores.PartitionViolation = fitness.PartitionViolations;

            foreach (var qoc in ev.Apps)
            {
                if (qoc.CA)
                {
                    temp.Scores.CoC.Add(qoc.Cost);
                }
            }
            foreach (var chain in ev.Apps)
            {
                temp.Scores.Chains.Add(chain.E2E);
            }

            foreach (var deadline in ev.Deadlines)
            {
                temp.Scores.Deadlines.Add(deadline.MaxDistance);
            }


            //temp.Scores.ExtensibilityScore = fitness.ExtensibilityPenalty;
        }
Ejemplo n.º 3
0
        private static void GenerateReport(string _resultfile, List <Simulation> s)
        {
            Evaluation _evaluation = new Evaluation();

            int count = 0;

            foreach (Simulation simulation in s)
            {
                if (true)
                {
                    Evaluation.Solution temp = new Evaluation.Solution();
                    temp.Id          = count;
                    temp.Hyperperiod = simulation.Environment.Hyperperiod;
                    SetCores(temp, simulation.Environment);
                    SetScores(temp, simulation.Fitness, simulation.Evaluator);

                    count++;
                    _evaluation.Solutions.Add(temp);
                }
            }
            Save(_resultfile, _evaluation);
        }