Class LsaNode
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Node
,it.unibo.alchemist.model.sapere.ILsaNode
,java.io.Serializable
,java.lang.Comparable
,java.lang.Iterable
,kotlin.jvm.internal.markers.KMappedMarker
public final class LsaNode extends GenericNode<T> implements ILsaNode
This class realizes a node with LSA concentration.
-
-
Field Summary
Fields Modifier and Type Field Description public final Incarnation<T, out Object>
incarnation
public final Environment<T, out Object>
environment
public final int
id
public final List<Reaction<T>>
reactions
public final Map<Molecule, T>
molecules
public final List<NodeProperty<T>>
properties
public final Map<Molecule, T>
contents
-
Constructor Summary
Constructors Constructor Description LsaNode(Environment<List<ILsaMolecule>, out Object> environment)
-
Method Summary
Modifier and Type Method Description boolean
contains(@Nonnull() Molecule molecule)
int
getMoleculeCount()
List<ILsaMolecule>
getConcentration(@Nonnull() Molecule m)
Map<Molecule, List<ILsaMolecule>>
getContents()
List<ILsaMolecule>
getLsaSpace()
boolean
removeConcentration(ILsaMolecule matchedInstance)
Deletes an ILsaMolecule from the Node LsaSpace Warning: the method removes only the first matched ILsaMolecule. void
setConcentration(ILsaMolecule inst)
Adds an instance of ILsaMolecule in the node's LsaSpace. void
setConcentration(@Nonnull() Molecule molecule, List<ILsaMolecule> c)
String
toString()
-
Methods inherited from class it.unibo.alchemist.model.nodes.GenericNode
addProperty, addReaction, cloneNode, compareTo, equals, forEach, getContents, getEnvironment, getId, getIncarnation, getMolecules, getProperties, getReactions, hashCode, iterator, removeConcentration, removeReaction, spliterator
-
Methods inherited from class it.unibo.alchemist.model.Node
asProperty, asPropertyOrNull
-
Methods inherited from class java.lang.Iterable
iterator, spliterator
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LsaNode
LsaNode(Environment<List<ILsaMolecule>, out Object> environment)
- Parameters:
environment
- The environment (used for safe node id computation)
-
-
Method Detail
-
getMoleculeCount
int getMoleculeCount()
-
getConcentration
List<ILsaMolecule> getConcentration(@Nonnull() Molecule m)
-
getContents
@Nonnull() Map<Molecule, List<ILsaMolecule>> getContents()
-
getLsaSpace
List<ILsaMolecule> getLsaSpace()
- Returns:
lsaMolecules in the node. This backs the internal LsaSpace: USE READ ONLY.
-
removeConcentration
boolean removeConcentration(ILsaMolecule matchedInstance)
Deletes an ILsaMolecule from the Node LsaSpace Warning: the method removes only the first matched ILsaMolecule.
- Parameters:
matchedInstance
- the molecule you want to remove- Returns:
true if the remove operation finish correctly, false otherwise.
-
setConcentration
void setConcentration(ILsaMolecule inst)
Adds an instance of ILsaMolecule in the node's LsaSpace.
- Parameters:
inst
- the molecule you want to add
-
setConcentration
void setConcentration(@Nonnull() Molecule molecule, List<ILsaMolecule> c)
-
-
-
-