/** * \brief Creates a species object from that specified in the XML protocol file * * <p>This method takes an object specified in the SPECIES mark-up and creates a simulation object * for that species * * @param aSimulator The simulation object used to simulate the conditions specified in the * protocol file * @param aSpRoot A Species mark-up within the specified protocol file */ public Species(Simulator aSimulator, XMLParser aSpRoot, XMLParser speciesDefaults) { // Name of the species as specified in the protocol file speciesName = aSpRoot.getName(); // colour is used to distinguish agents in POV-Ray output images - read this from the protocol // file String colorName = aSpRoot.getParam("color"); // Set the colour to white if not specified if (colorName == null) colorName = "white"; // Translate this text string into a colour color = utils.UnitConverter.getColor(colorName); // Register this species // KA 8/3/13 - is this correct - this is storing the number of species in the simulation speciesIndex = aSimulator.speciesList.size(); // Take a local copy of the current simulation currentSimulator = aSimulator; // KA May 2013 // If this is self-attach, useful to store the injection period parameters here, so can // reference these later cellInjectionStartHour = aSpRoot.getParamDbl("cellInjectionStartHour"); injectionOnAttachmentFrequency = aSpRoot.getParamDbl("injectionOnAttachmentFrequency"); cellInjectionEndHour = aSpRoot.getParamDbl("cellInjectionEndHour"); injectionOffAttachmentFrequency = aSpRoot.getParamDbl("injectionOffAttachmentFrequency"); // Create the progenitor and tune its speciesParam object _progenitor = (SpecialisedAgent) aSpRoot.instanceCreator("simulator.agent.zoo"); // Get parameters for this progenitor object from the protocol file if present _progenitor.getSpeciesParam().init(aSimulator, aSpRoot, speciesDefaults); _progenitor.setSpecies(this); // Set the computational domain this species is associated with // KA Aug 13 - changed as this may be a default domain = aSimulator.world.getDomain( _progenitor .getSpeciesParam() .getSpeciesParameterString("computationDomain", aSpRoot, speciesDefaults)); }
/** * \brief Return the parameters associated with this species (a SpeciesParam object) * * <p>Return the parameters associated with this species. These are contained within a * SpeciesParam object * * @return SpeciesParam object associated with this Species */ public SpeciesParam getSpeciesParam() { return _progenitor.getSpeciesParam(); }