it.unibo.alchemist.model.interfaces.Incarnation Maven / Gradle / Ivy
Show all versions of alchemist-interfaces Show documentation
/*
* Copyright (C) 2010-2019, Danilo Pianini and contributors listed in the main project's alchemist/build.gradle file.
*
* This file is part of Alchemist, and is distributed under the terms of the
* GNU General Public License, with a linking exception,
* as described in the file LICENSE in the Alchemist distribution's top directory.
*/
package it.unibo.alchemist.model.interfaces;
import org.apache.commons.math3.random.RandomGenerator;
import org.jetbrains.annotations.Nullable;
/**
* @param
* Concentration type
* @param
* Concentration type
*/
public interface Incarnation> {
/**
* Given an {@link Node}, an {@link Molecule} and a property expressed as
* a {@link String}, returns a numeric value. If a numeric value is not
* deducible, Double.NaN is returned.
*
* @param node
* the node
* @param molecule
* the molecule to analyze
* @param property
* the property to extract
* @return a numeric value representing the property
*/
double getProperty(Node node, Molecule molecule, String property);
/**
* Parses a {@link String}, and provides a {@link Molecule}.
*
* @param s
* the {@link String} to parse
* @return an {@link Molecule} created parsing the passed {@link String}
*/
Molecule createMolecule(String s);
/**
* Creates a new concentration object of a specific concrete type.
*
* @param s the {@link String} to parse
* @return a concentration of a certain concrete type
*/
T createConcentration(String s);
/**
* @param randomGenerator
* the random engine
* @param environment
* the environment that will host this object
* @param parameter
* a {@link String} describing the object
* @return a new {@link TimeDistribution}
*/
Node createNode(RandomGenerator randomGenerator, Environment environment, @Nullable String parameter);
/**
* @param randomGenerator
* the random engine
* @param environment
* the environment that will host this object
* @param node
* the node that will host this object
* @param parameter
* a {@link String} describing the object
* @return a new {@link TimeDistribution}
*/
TimeDistribution createTimeDistribution(
RandomGenerator randomGenerator,
Environment environment,
Node node,
@Nullable String parameter
);
/**
* @param randomGenerator
* the random engine
* @param environment
* the environment that will host this object
* @param node
* the node that will host this object
* @param timeDistribution
* the time distribution of the reaction
* @param parameter
* a {@link String} describing the object
* @return a new {@link Reaction}
*/
Reaction createReaction(
RandomGenerator randomGenerator,
Environment environment,
Node node,
TimeDistribution timeDistribution,
String parameter
);
/**
* @param randomGenerator
* the random engine
* @param environment
* the environment that will host this object
* @param node
* the node that will host this object
* @param time
* the time distribution of the reaction
* @param reaction
* the reaction hosting this object
* @param additionalParameters
* a {@link String} describing the object
* @return a new {@link Condition}
*/
Condition createCondition(
RandomGenerator randomGenerator,
Environment environment,
Node node,
TimeDistribution time,
Reaction reaction,
String additionalParameters
);
/**
* @param randomGenerator
* the random engine
* @param environment
* the environment that will host this object
* @param node
* the node that will host this object
* @param time
* the time distribution of the reaction
* @param reaction
* the reaction hosting this object
* @param additionalParameters
* a {@link String} describing the object
* @return a new {@link Action}
*/
Action createAction(
RandomGenerator randomGenerator,
Environment environment,
Node node,
TimeDistribution time,
Reaction reaction,
String additionalParameters
);
}