public void Setup()
 {
     environment = new SimulationEnvironment {
         LightPosition = new Vertex(0, 10000, 0), Temperature = 22
     };
     plant                         = TestPlant.CreatePlant();
     cellFactory                   = new GenericCellFactory();
     optionsService                = PlantSimulatorOptionsHelper.CreateOptionsService();
     divider                       = new GenericCellDivider(cellFactory);
     helper                        = new GeometryHelper();
     cellSizer                     = new GenericCellSizer(helper, new LoggerAdapter <GenericCellSizer>(new NullLogger <GenericCellSizer>()));
     cellCollisionDetection        = new CellCollisionDetection(helper);
     bodySystemSolver              = new GenericCellBodySystemSolver(cellCollisionDetection, cellSizer);
     cellGrower                    = new GenericCellGrower(plant, environment, bodySystemSolver, optionsService);
     descriptorService             = new PlantDescriptorService();
     cellCreator                   = new HexagonCellCreator(cellFactory);
     gridCreator                   = new HexagonalCellGridFactory(cellCreator, CornCellTypeLocator.GetCornCellTypeLocator(), optionsService);
     plantPartCellCreator          = new PlantPartCellCreator(gridCreator);
     internodePartFactory          = new GenericInternodePartFactory(optionsService, gridCreator);
     stemPartFactory               = new GenericStemPartFactory(optionsService, internodePartFactory);
     petiolePartFactory            = new GenericPetiolePartFactory(cellFactory, optionsService);
     nodePartFactory               = new GenericNodePartFactory(optionsService, cellFactory, stemPartFactory, petiolePartFactory);
     internodePlantPartDevelopment = new InternodePartDevelopment(optionsService, nodePartFactory, cellGrower, descriptorService, internodePartFactory);
     rootFactory                   = new GenericRootPartFactory(optionsService, plantPartCellCreator);
     rootPlantPartDevelopment      = new RootPartDevelopment(optionsService, nodePartFactory, rootFactory, cellGrower, descriptorService);
     developer                     = new PlantPartDeveloper(internodePlantPartDevelopment, rootPlantPartDevelopment);
     sucroseCarrierCollection      =
         new SucroseCarrierCollection(
             new LoggerAdapter <SucroseCarrierCollection>(new NullLogger <SucroseCarrierCollection>()));
     sucroseTransporter     = new SucroseTransporter(cellCollisionDetection, helper, sucroseCarrierCollection, new LoggerAdapter <FluidTransporter <Sucrose> >(new NullLogger <FluidTransporter <Sucrose> >()));
     plantGrower            = new GenericPlantGrower(bodySystemSolver, developer, sucroseTransporter);
     runner                 = new GenericPlantRunner(plant, environment, plantGrower, new FluidsPlantCycle(plant, optionsService, sucroseCarrierCollection, new LoggerAdapter <FluidsPlantCycle>(new NullLogger <FluidsPlantCycle>())));
     RangeExtensions.Random = new Random(optionsService.Options.Simulation.RandomSeed);
 }
 public PlantSimulator(ILoggerAdapter <PlantSimulator> logger, IPlantSimulatorOptionsService optionsService, IPlantRunner plantRunner)
 {
     this.logger         = logger;
     this.optionsService = optionsService;
     this.plantRunner    = plantRunner;
 }