Package-level declarations

Types

Link copied to clipboard

Base implementation of an ILsaAction, executed on the ILsaNode hosting its reaction.

Link copied to clipboard

A SAPERE agent stub, which can only modify the molecules matching the templates passed at construction time. Agents are not meant to be cloned.

Link copied to clipboard

A SAPERE agent aware of the environment hosting its node.

Link copied to clipboard
abstract class AbstractSAPEREMoveNodeAgent<P : Position<P>> @JvmOverloads constructor(environment: Environment<List<ILsaMolecule>, P>, reaction: NodeReaction<List<ILsaMolecule>>, molecule: ILsaMolecule? = null) : AbstractSAPEREEnvironmentAgent<P>

A SAPERE agent moving the node hosting it in the environment. If a molecule template is provided, the agent modifies (locally!) the molecules matching it, otherwise it does not modify any molecule (e.g., an agent that just moves a node).

Link copied to clipboard

A SAPERE agent that modifies something on neighboring nodes.

Link copied to clipboard

Adds the LSA molecule to all the valid neighbors. The molecule can be different from a neighbor to the other, because some special variables (e.g., #D) are specific for each node: N molecules are instanced if there are N neighbors. The randomGenerator is unused, and can be null.

Link copied to clipboard

Moves the node towards the neighbor with the lowest value of the template LSA (typically a gradient) in position pos, by at most LIMIT along each axis, unless that neighbor is active.

Link copied to clipboard

Moves the response LSA to the last neighbor found with a lower gradient distance, adding the distance to that neighbor to the distance carried by the response.

Link copied to clipboard
class LsaChangeArgument(reaction: NodeReaction<List<ILsaMolecule>>, listTarget: Array<String>, targetVariable: String, randomGenerator: RandomGenerator) : AbstractSAPEREAgent

Picks at random a type in listTarget other than the one matched by the variable OldType, and adds it to the matches as the variable targetVariable. The execution has no effect on the influenced molecules of the reaction.

Link copied to clipboard
class LsaCountNeighborsAction(environment: Environment<List<ILsaMolecule>, *>, reaction: NodeReaction<List<ILsaMolecule>>, moleculeToCount: ILsaMolecule, countVariable: HashString, randomGenerator: RandomGenerator) : AbstractSAPEREAgent

Counts the neighbors containing in their LSA space a molecule matching moleculeToCount, and adds the result to the matches as the variable countVariable. The execution has no effect on the set of influenced molecules of the reaction. The randomGenerator is unused.

Link copied to clipboard
open class LsaRandomNeighborAction(randomGenerator: RandomGenerator?, environment: Environment<List<ILsaMolecule>, *>, reaction: NodeReaction<List<ILsaMolecule>>, molecule: ILsaMolecule) : LsaStandardAction

Adds the LSA molecule to a neighbor: the one selected by a previous neighborhood condition, if any, otherwise a random valid neighbor drawn using randomGenerator. Example: +<id, X, n>.

Link copied to clipboard
open class LsaStandardAction(randomGenerator: RandomGenerator?, reaction: NodeReaction<List<ILsaMolecule>>, val molecule: ILsaMolecule) : AbstractLsaAction

Adds the LSA molecule, with its variables allocated using the current matches, to the local node. The randomGenerator is used to allocate #RAND, if present.

Link copied to clipboard
class SAPEREChemotaxis<P : Position<P>>(environment: Environment<List<ILsaMolecule>, P>, reaction: NodeReaction<List<ILsaMolecule>>, response: ILsaMolecule, gradient: ILsaMolecule, idPosition: Int) : AbstractSAPERENeighborAgent<P>

A chemotaxis implementation for SAPERE, namely, an agent able to move the response molecule towards the node whose ID is in position idPosition of the matched gradient template.

Link copied to clipboard

Matches template, removes a single instance of it from the current node, and moves it to destination. Since the destination could be anywhere in the system, this action may trigger a large number of updates, slowing down the whole simulation. Handle with care.

Link copied to clipboard

Follows a GPS trace on the streets, slowing down by the interaction factor near the nodes tagged with tag within range. The reaction is used to compute the movement length, the node walks at an average speed.

Link copied to clipboard

Walks on the streets following the gradient described by templateLSA, whose argument in position neighPos contains the next hop, slowing down by the interaction factor near the nodes tagged with tag within range. The reaction is used to compute the movement length, the node walks at an average speed.