Beispiel #1
0
        public void add(ISimulationResults res)
        {
            foreach (ITrajectory t in res.getTrajectories())
            {
                ITrajectoryBundle tb = null;

                if (!_tbundles.ContainsKey(t.Name))
                {
                    tb = new TrajectoryBundle(t.Name);
                    _tbundles.Add(t.Name, tb);
                }
                else
                {
                    tb = _tbundles[t.Name];
                }
                tb.addTrajectory(t);
            }

            foreach (IAgentEvaluation ae in res.getAgentEvaluations())
            {
                IAgentEvaluationBundle aeb = null;
                if (!_aebundles.ContainsKey(ae.Name))
                {
                    aeb = new AgentEvaluationBundle(ae.Name);
                    _aebundles.Add(ae.Name, aeb);
                }
                else
                {
                    aeb = _aebundles[ae.Name];
                }
                aeb.addAgentEvaluation(ae);
            }
        }
        public IBlauSpaceEvaluation eval(IAgentEvaluationBundle aeb, IBlauSpaceLattice lattice)
        {
            IBlauSpaceEvaluation meanEval = aeb.MeanEvaluation(lattice);

            IBlauSpaceMultiEvaluation bsme = new BlauSpaceMultiEvaluation(aeb.Name, lattice);
            IBlauSpaceEvaluation      bse  = new BlauSpaceEvaluation(aeb.Name + "-Std", lattice);

            foreach (IAgentEvaluation ae in aeb.Evaluations)
            {
                ae.AddToBlauSpaceMultiEvaluation(bsme);
            }
            foreach (IBlauPoint p in bsme.AssignedLatticePoints)
            {
                LinkedList <IScore> scores = bsme.eval(p);
                double meanValue           = meanEval.eval(p);

                double total = 0.0;
                int    count = 0;
                foreach (IScore s in scores)
                {
                    double delta = (s.Value - meanValue);
                    total += (delta * delta);
                    count++;
                }
                double mean = Math.Sqrt(total) / (double)count;
                bse.set(p, mean);
            }
            return(bse);
        }
Beispiel #3
0
        public IBlauSpaceEvaluation eval(IAgentEvaluationBundle aeb, IBlauSpaceLattice lattice)
        {
            IBlauSpaceMultiEvaluation bsme = new BlauSpaceMultiEvaluation(aeb.Name, lattice);
            IBlauSpaceEvaluation      bse  = new BlauSpaceEvaluation(aeb.Name + "-Mean", lattice);

            foreach (IAgentEvaluation ae in aeb.Evaluations)
            {
                ae.AddToBlauSpaceMultiEvaluation(bsme);
            }
            foreach (IBlauPoint p in bsme.AssignedLatticePoints)
            {
                LinkedList <IScore> scores = bsme.eval(p);
                double count = (double)scores.Count;
                bse.set(p, (double)count);
            }
            return(bse);
        }
Beispiel #4
0
        public IBlauSpaceLattice getLattice(IDistribution d, IAgentEvaluationBundle aeb)
        {
            IAgentEvaluationFactory aef = null;;

            foreach (IAgentEvaluation iae in aeb.Evaluations)
            {
                aef = iae.Creator;
                break;
            }

            int[] steps = new int[d.SampleSpace.Dimension];
            for (int j = 0; j < d.SampleSpace.Dimension; j++)
            {
                steps[j] = getAgentEvaluationConfig(aef).BlauSpaceGridding;
            }
            IBlauSpaceLattice bsl = BlauSpaceLattice.create(d.SampleSpace, steps);

            return(bsl);
        }
Beispiel #5
0
        public void add(ISimulationResultsBundle resb)
        {
            foreach (ITrajectoryBundle tb in resb.getTrajectoryBundles())
            {
                foreach (ITrajectory t in tb.Trajectories)
                {
                    ITrajectoryBundle newtb = null;
                    if (!_tbundles.ContainsKey(t.Name))
                    {
                        newtb = new TrajectoryBundle(t.Name);
                        _tbundles.Add(t.Name, newtb);
                    }
                    else
                    {
                        newtb = _tbundles[t.Name];
                    }
                    newtb.addTrajectory(t);
                }
            }

            foreach (IAgentEvaluationBundle aeb in resb.getAgentEvaluationBundles())
            {
                foreach (IAgentEvaluation ae in aeb.Evaluations)
                {
                    IAgentEvaluationBundle newaeb = null;
                    if (!_aebundles.ContainsKey(ae.Name))
                    {
                        newaeb = new AgentEvaluationBundle(ae.Name);
                        _aebundles.Add(ae.Name, newaeb);
                    }
                    else
                    {
                        newaeb = _aebundles[ae.Name];
                    }
                    aeb.addAgentEvaluation(ae);
                }
            }
        }
        public IBlauSpaceEvaluation eval(IAgentEvaluationBundle aeb, IBlauSpaceLattice lattice)
        {
            IBlauSpaceMultiEvaluation bsme = new BlauSpaceMultiEvaluation(aeb.Name, lattice);
            IBlauSpaceEvaluation      bse  = new BlauSpaceEvaluation(aeb.Name + "-Mean", lattice);

            foreach (IAgentEvaluation ae in aeb.Evaluations)
            {
                ae.AddToBlauSpaceMultiEvaluation(bsme);
            }
            foreach (IBlauPoint p in bsme.AssignedLatticePoints)
            {
                LinkedList <IScore> scores = bsme.eval(p);
                double total = 0.0;
                int    count = 0;
                foreach (IScore s in scores)
                {
                    total += s.Value;
                    count++;
                }
                double mean = total / (double)count;
                bse.set(p, mean);
            }
            return(bse);
        }