Ejemplo n.º 1
0
        private ISimulation MakeSimulation(int trial, int totalTrials)
        {
            IPopulation pop2;

            // WE NO LONGER DO ANYTHING BASED ON trial versus totalTrials
            pop2 = _pop.clone();

            /*
             * if (trial < totalTrials - 1) {
             *      pop2 = _pop.clone ();
             *      Console.WriteLine("FFF Trial "+trial+" cloning the master pop");
             * } else if (trial == totalTrials - 1) {
             *      pop2 = _pop;
             *      Console.WriteLine("FFF Trial "+trial+" using the master pop");
             * } else {
             *      throw new Exception ("Trial number exceeds total number of trials");
             * }
             */

            IOrderbook_Observable ob2 = _ob.clone();
            double time2     = _starttime;
            double duration2 = _duration;

            ISimulation sim2 = new Simulation(pop2, ob2, time2, duration2, _addLogger, _tag + "-trial-" + trial);

            foreach (IPassiveTrajectoryFactory tf in getPassiveTrajectoryFactories())
            {
                sim2.add(tf);
            }
            foreach (IAgentEvaluationFactory aef in getAgentEvaluationFactories())
            {
                sim2.add(aef);
            }
            return(sim2);
        }
Ejemplo n.º 2
0
        public SimulationBundle(IPopulation pop, IOrderbook_Observable ob, double starttime, double duration, bool addLogger, string tag)
        {
            _pop       = pop;
            _ob        = ob;
            _starttime = starttime;
            _duration  = duration;
            _addLogger = addLogger;
            _tag       = tag;

            _name2tf = new Dictionary <string, IPassiveTrajectoryFactory>();
            _name2af = new Dictionary <string, IAgentEvaluationFactory>();
        }
Ejemplo n.º 3
0
        public Simulation(IPopulation pop, IOrderbook_Observable ob, double starttime, double duration, bool addLogger, string tag)
        {
            _pop       = pop;
            _ob        = ob;
            _starttime = starttime;
            _duration  = duration;

            _ob.addObserver(this);
            if (addLogger)
            {
                _ob.addObserver(new OrderbookLogger(tag));
            }

            _tflist = new List <IPassiveTrajectoryFactory>();
            _aflist = new List <IAgentEvaluationFactory>();
        }