public class DefaultAmountManager extends Object implements AmountManager
Constructor and Description |
---|
DefaultAmountManager(Network net)
Creates an
AmountManager for a given network |
Modifier and Type | Method and Description |
---|---|
long |
getAmount(int species)
Gets the current amount of a species.
|
void |
performReaction(int reaction,
int times)
Reflects a (multiple) firing of a reaction by adjusting the populations of the reactants and
the products.
|
void |
resetAmount()
Resets the amount of each species to the initial amount retrieved by the networks
AnnotationManager . |
void |
rollback()
Restore the amount array from the recently saved one.
|
void |
save()
Makes a copy of the amount array.
|
void |
setAmount(int species,
long amount)
Sets the current amount of a species.
|
public DefaultAmountManager(Network net)
AmountManager
for a given networknet
- the networkpublic void performReaction(int reaction, int times)
RuntimeException
is thrown.performReaction
in interface AmountManager
reaction
- the index of the reaction firedtimes
- the number of firingspublic long getAmount(int species)
getAmount
in interface AmountManager
species
- index of the speciespublic void setAmount(int species, long amount)
setAmount
in interface AmountManager
species
- index of the speciespublic void resetAmount()
AnnotationManager
. This is called whenever a Simulator
is started.resetAmount
in interface AmountManager
public void save()
save
in interface AmountManager
public void rollback()
rollback
in interface AmountManager
Copyright © 2007–2021. All rights reserved.