fern.network
Class ConstantAmountManager

java.lang.Object
  extended by fern.network.ConstantAmountManager
All Implemented Interfaces:
AmountManager

public class ConstantAmountManager
extends Object
implements AmountManager


Constructor Summary
ConstantAmountManager(long constantAmount)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantAmountManager

public ConstantAmountManager(long constantAmount)
Method Detail

getAmount

public long getAmount(int species)
Description copied from interface: AmountManager
Gets the current amount of a species.

Specified by:
getAmount in interface AmountManager
Parameters:
species - index of the species
Returns:
actual amount of the species

performReaction

public void performReaction(int reaction,
                            int times)
Description copied from interface: AmountManager
Reflects a (multiple) firing of a reaction by adjusting the populations of the reactants and the products. If a population becomes negative, a RuntimeException is thrown.

Specified by:
performReaction in interface AmountManager
Parameters:
reaction - the index of the reaction fired
times - the number of firings

resetAmount

public void resetAmount()
Description copied from interface: AmountManager
Resets the amount of each species to the initial amount retrieved by the networks AnnotationManager. This is called whenever a Simulator is started.

Specified by:
resetAmount in interface AmountManager

rollback

public void rollback()
Description copied from interface: AmountManager
Restore the amount array from the recently saved one.

Specified by:
rollback in interface AmountManager

save

public void save()
Description copied from interface: AmountManager
Makes a copy of the amount array.

Specified by:
save in interface AmountManager

setAmount

public void setAmount(int species,
                      long amount)
Description copied from interface: AmountManager
Sets the current amount of a species.

Specified by:
setAmount in interface AmountManager
Parameters:
species - index of the species