Class ConcentrationContainer
- java.lang.Object
-
- bio.singa.simulation.model.sections.ConcentrationContainer
-
public class ConcentrationContainer extends Object
The concentration container manages the concentrations of one updatable.MolarConcentrations ofChemicalEntitys can be set and got by theCellSubsectionorCellTopology. If no relevant concentration was registered an empty concentration will be returned.- Author:
- cl
-
-
Constructor Summary
Constructors Constructor Description ConcentrationContainer()Creates a new concentration container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsEntity(CellSubsection subsection, ChemicalEntity entity)booleancontainsEntity(CellTopology topology, ChemicalEntity entity)Optional<ChemicalEntity>containsHiddenEntity(CellTopology topology, ChemicalEntity query)ConcentrationContaineremptyCopy()Returns a empty copy of this container, keeping subsections and cell topologies associated.ConcentrationContainerfullCopy()Returns a full copy of this container, keeping concentrations.doubleget(CellSubsection subsection, ChemicalEntity entity)Returns the concentration of the entity in the corresponding subsection.doubleget(CellTopology topology, ChemicalEntity entity)Returns the concentration of the entity in the corresponding topology.ConcentrationPool[]getConcentrations()CellSubsectiongetInnerSubsection()Returns the inner subsection.CellSubsectiongetMembraneSubsection()Returns the membrane subsection.CellSubsectiongetOuterSubsection()Returns the outer subsection.Map.Entry<CellTopology,ConcentrationPool>getPool(CellSubsection subsection)Returns the topology and concentration pool for the subsection.Map.Entry<CellSubsection,ConcentrationPool>getPool(CellTopology topology)Returns the subsection and concentration pool for the topology.Collection<ConcentrationPool>getPoolsOfConcentration()Returns all concentration pools in this container.Set<ChemicalEntity>getReferencedEntities()Returns all entities referenced in any concentration pool.Set<CellSubsection>getReferencedSubsections()Returns all subsections, referenced in this container.CellSubsectiongetSubsection(CellTopology topology)Returns the subsection corresponding to the topology.voidinitialize(CellSubsection subsection, ChemicalEntity entity, javax.measure.Quantity<bio.singa.features.quantities.MolarConcentration> concentration)voidinitialize(CellTopology topology, ChemicalEntity entity, javax.measure.Quantity<bio.singa.features.quantities.MolarConcentration> concentration)voidinitializeSubsection(CellSubsection subsection, CellTopology topology)Initializes a new concentration pool for the corresponding subsection and topology.voidputSubsectionPool(CellSubsection subsection, CellTopology topology, ConcentrationPool concentrationPool)Adds a concentration pool, referenced to the subsection and topology.voidremoveSubsection(CellSubsection subsection)Removes a subsection, the corresponding topology and concentration pool from the container.voidremoveSubsection(CellTopology topology)Removes a subsection, the given topology and concentration pool from the container.voidset(CellSubsection subsection, ChemicalEntity entity, double concentration)Sets the concentration of the given entity in the given subsection.voidset(CellTopology topology, ChemicalEntity entity, double concentration)Sets the concentration of the given entity in the given topology.
-
-
-
Method Detail
-
initializeSubsection
public void initializeSubsection(CellSubsection subsection, CellTopology topology)
Initializes a new concentration pool for the corresponding subsection and topology.- Parameters:
subsection- The subsection.topology- The topology.
-
putSubsectionPool
public void putSubsectionPool(CellSubsection subsection, CellTopology topology, ConcentrationPool concentrationPool)
Adds a concentration pool, referenced to the subsection and topology.- Parameters:
subsection- The subsection.topology- The topology.concentrationPool- The concentration pool.
-
removeSubsection
public void removeSubsection(CellSubsection subsection)
Removes a subsection, the corresponding topology and concentration pool from the container.- Parameters:
subsection- The subsection to remove.
-
removeSubsection
public void removeSubsection(CellTopology topology)
Removes a subsection, the given topology and concentration pool from the container.- Parameters:
topology- The topology to remove.
-
getConcentrations
public ConcentrationPool[] getConcentrations()
-
getReferencedSubsections
public Set<CellSubsection> getReferencedSubsections()
Returns all subsections, referenced in this container.- Returns:
- All subsections, referenced in this container.
-
getPoolsOfConcentration
public Collection<ConcentrationPool> getPoolsOfConcentration()
Returns all concentration pools in this container.- Returns:
- All concentration pools in this container.
-
getReferencedEntities
public Set<ChemicalEntity> getReferencedEntities()
Returns all entities referenced in any concentration pool.- Returns:
- All entities referenced in any concentration pool.
-
containsHiddenEntity
public Optional<ChemicalEntity> containsHiddenEntity(CellTopology topology, ChemicalEntity query)
-
containsEntity
public boolean containsEntity(CellTopology topology, ChemicalEntity entity)
-
containsEntity
public boolean containsEntity(CellSubsection subsection, ChemicalEntity entity)
-
getPool
public Map.Entry<CellTopology,ConcentrationPool> getPool(CellSubsection subsection)
Returns the topology and concentration pool for the subsection.- Parameters:
subsection- The subsection.- Returns:
- The topology and concentration pool for the subsection.
-
getPool
public Map.Entry<CellSubsection,ConcentrationPool> getPool(CellTopology topology)
Returns the subsection and concentration pool for the topology.- Parameters:
topology- Th topology.- Returns:
- The subsection and concentration pool for the topology.
-
get
public double get(CellSubsection subsection, ChemicalEntity entity)
Returns the concentration of the entity in the corresponding subsection.- Parameters:
subsection- The subsection.entity- The entity.- Returns:
- The concentration of the entity in the corresponding subsection.
-
get
public double get(CellTopology topology, ChemicalEntity entity)
Returns the concentration of the entity in the corresponding topology.- Parameters:
topology- The topology.entity- The entity.- Returns:
- The concentration of the entity in the corresponding topology.
-
set
public void set(CellSubsection subsection, ChemicalEntity entity, double concentration)
Sets the concentration of the given entity in the given subsection.- Parameters:
subsection- The subsection.entity- The entity.concentration- The concentration.
-
initialize
public void initialize(CellSubsection subsection, ChemicalEntity entity, javax.measure.Quantity<bio.singa.features.quantities.MolarConcentration> concentration)
-
set
public void set(CellTopology topology, ChemicalEntity entity, double concentration)
Sets the concentration of the given entity in the given topology.- Parameters:
topology- The topology.entity- The entity.concentration- The concentration.
-
initialize
public void initialize(CellTopology topology, ChemicalEntity entity, javax.measure.Quantity<bio.singa.features.quantities.MolarConcentration> concentration)
-
getSubsection
public CellSubsection getSubsection(CellTopology topology)
Returns the subsection corresponding to the topology.- Parameters:
topology- The topology.- Returns:
- The subsection.
-
getInnerSubsection
public CellSubsection getInnerSubsection()
Returns the inner subsection.- Returns:
- The inner subsection.
-
getOuterSubsection
public CellSubsection getOuterSubsection()
Returns the outer subsection.- Returns:
- The outer subsection.
-
getMembraneSubsection
public CellSubsection getMembraneSubsection()
Returns the membrane subsection.- Returns:
- The membrane subsection.
-
emptyCopy
public ConcentrationContainer emptyCopy()
Returns a empty copy of this container, keeping subsections and cell topologies associated.- Returns:
- A empty copy of this container.
-
fullCopy
public ConcentrationContainer fullCopy()
Returns a full copy of this container, keeping concentrations.- Returns:
- A full copy of this container.
-
-