-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Dependency,it.unibo.alchemist.model.interfaces.ILsaMolecule,it.unibo.alchemist.model.interfaces.Molecule,java.io.Serializable,java.lang.Comparable,java.lang.Iterable
public final class LsaMolecule extends SimpleMolecule implements ILsaMolecule
This class realizes an LsaMolecule, where arguments are of type Expression.
-
-
Field Summary
Fields Modifier and Type Field Description public final static HashStringSYN_Dpublic final static HashStringSYN_MOL_IDpublic final static HashStringSYN_NEIGHpublic final static HashStringSYN_NODE_IDpublic final static HashStringSYN_Opublic final static HashStringSYN_RANDpublic final static HashStringSYN_ROUTEpublic final static HashStringSYN_SELECTEDpublic final static HashStringSYN_T
-
Constructor Summary
Constructors Constructor Description LsaMolecule()Empty molecule, no arguments. LsaMolecule(List<IExpression> listArgs)Builds a new LsaMolecule by interpreting a list of IExpressions. LsaMolecule(LsaMolecule m)Very fast constructor, produces a copy of an LsaMolecule. LsaMolecule(String argsString)Builds a LsaMolecule by parsing the passed String. LsaMolecule(String argsString, String description)Builds a LsaMolecule by parsing the passed String.
-
Method Summary
Modifier and Type Method Description List<IExpression>allocateVar(Map<HashString, ITreeNode<out Object>> matches)intargsNumber()intcompareTo(ILsaMolecule o)booleandependsOn(Dependency m)booleanequals(Object o)voidforEach(Consumer<out Object> action)ILsaMoleculegeneralize()IExpressiongetArg(int i)booleanhasDuplicateVariables()inthashCode()booleanisIdenticalTo(ILsaMolecule mol)booleanisIstance()Iterator<IExpression>iterator()booleanmatches(ILsaMolecule mol)booleanmatches(List<out IExpression> mol, boolean duplicateVariables)booleanmoreGenericOf(ILsaMolecule mol)intsize()Spliterator<IExpression>spliterator()HashStringtoHashString()StringtoString()-
Methods inherited from class it.unibo.alchemist.model.implementations.molecules.SimpleMolecule
getName -
Methods inherited from class it.unibo.alchemist.model.interfaces.Dependency
makesDependent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LsaMolecule
LsaMolecule()
Empty molecule, no arguments.
-
LsaMolecule
LsaMolecule(List<IExpression> listArgs)
Builds a new LsaMolecule by interpreting a list of IExpressions.- Parameters:
listArgs- the list of IExpressions
-
LsaMolecule
LsaMolecule(LsaMolecule m)
Very fast constructor, produces a copy of an LsaMolecule.- Parameters:
m- the LsaMolecule to copy
-
LsaMolecule
LsaMolecule(String argsString)
Builds a LsaMolecule by parsing the passed String.- Parameters:
argsString- the String to parse
-
-
Method Detail
-
allocateVar
List<IExpression> allocateVar(Map<HashString, ITreeNode<out Object>> matches)
- Parameters:
matches- the map with the variable / value bindings
-
argsNumber
int argsNumber()
-
compareTo
int compareTo(ILsaMolecule o)
-
dependsOn
boolean dependsOn(Dependency m)
-
generalize
ILsaMolecule generalize()
-
getArg
IExpression getArg(int i)
- Parameters:
i- : position of the argument to get
-
hasDuplicateVariables
boolean hasDuplicateVariables()
-
hashCode
int hashCode()
-
isIdenticalTo
boolean isIdenticalTo(ILsaMolecule mol)
- Parameters:
mol- the molecule to compare to
-
isIstance
boolean isIstance()
-
iterator
Iterator<IExpression> iterator()
-
matches
boolean matches(ILsaMolecule mol)
- Parameters:
mol- the LsaMolecule to try to match with.
-
matches
boolean matches(List<out IExpression> mol, boolean duplicateVariables)
- Parameters:
mol- the LsaMolecule to try to match withduplicateVariables- if true, the matching of variables reused within the same tuple is enabled
-
moreGenericOf
boolean moreGenericOf(ILsaMolecule mol)
- Parameters:
mol- the molecule to compare to
-
size
int size()
-
spliterator
Spliterator<IExpression> spliterator()
-
toHashString
HashString toHashString()
-
-
-
-