picsou.pricing
Interface Simulator

All Known Implementing Classes:
EuropeanBarrier, EuropeanBarrierDown, EuropeanBarrierDownIn, EuropeanBarrierDownOut, EuropeanBarrierUp, EuropeanBarrierUpIn, EuropeanBarrierUpOut, EuropeanSimple, EuropeanSimpleGrid, PricingSimulator, PricingSimulatorTree

public interface Simulator


Method Summary
 org.objectweb.proactive.core.util.wrapper.BooleanWrapper autorun(Simulator sim)
          Ask the simulator to run, pulling tasks from sim and merging them back in as they complete.
 OptionSet getOptionSet()
          Returns the OptionSet entry state: any exit state: unchanged
 State getState()
          Returns the current state entry state: any exit state: unchanged
 void init(Algorithm alg, Asset asset)
          Sets up the Simulator with an algorithm and an asset.
 void init(OptionSet optionSet)
          Sets up the Simulator with an algorithm and an asset.
 void merge(Simulator sim)
          Adds the results of another simulator to this Simulator.
 org.objectweb.proactive.core.util.wrapper.IntWrapper offload(Simulator sim)
          Offer a number of the queued iterations to another simulator.
 void reset()
          Resets Simulator to initial (cleared) state.
 void restart()
          Clears the current results to restart the Simulator with the original Algorithm and Asset (cleared of Performance and Price results).
 void seed(Simulator sim)
          Seeds the current Simulator from the state of another Simulator.
 void simulate()
          Do a simulation on the asset with the given parameters and using all remaining iterations entry state: READY or RUNNING exit state: DONE
 org.objectweb.proactive.core.util.wrapper.IntWrapper simulate(java.lang.Integer iterations)
          Attempt to simulate up to "iterations", return actual number completed.
 

Method Detail

init

void init(OptionSet optionSet)
Sets up the Simulator with an algorithm and an asset. entry state: ANY exit state: READY

Parameters:
alg -
asset -

init

void init(Algorithm alg,
          Asset asset)
Sets up the Simulator with an algorithm and an asset. entry state: ANY exit state: READY

Parameters:
alg -
asset -

simulate

void simulate()
Do a simulation on the asset with the given parameters and using all remaining iterations entry state: READY or RUNNING exit state: DONE


simulate

org.objectweb.proactive.core.util.wrapper.IntWrapper simulate(java.lang.Integer iterations)
Attempt to simulate up to "iterations", return actual number completed. Simulator will not simulate more than the total iterations set by the Algorithm, so the smaller of queuedIterations and requestedIterations will be passed to unguarded simulate. entry state: READY or RUNNING exit state: RUNNING or DONE

Parameters:
iterations -
Returns:
Integer

autorun

org.objectweb.proactive.core.util.wrapper.BooleanWrapper autorun(Simulator sim)
Ask the simulator to run, pulling tasks from sim and merging them back in as they complete. Returns "true" when done. Should never return "false". This is a PA artifact, since the returned object allows PA to hold a future to synchronise on. entry state: not INIT exit state: not INIT


offload

org.objectweb.proactive.core.util.wrapper.IntWrapper offload(Simulator sim)
Offer a number of the queued iterations to another simulator. Do not assume they will be completed (perhaps partial, perhaps none), so do not decrease any queued iteration count. Implementation may choose to count how many have been offloaded. entry state: READY or RUNNING exit state: unchanged


merge

void merge(Simulator sim)
Adds the results of another simulator to this Simulator. Pre-conditions on "sim": RUNNING or DONE, Asset must be identical, except for "simulation" count. Pre-conditions on "this": READY or RUNNING, this.completedSimulations + sim.completedSimulations <= this.simulations entry state: READY or RUNNING exit state: RUNNING or DONE

Parameters:
sim -

seed

void seed(Simulator sim)
Seeds the current Simulator from the state of another Simulator. Currently this is synonymous with "this = sim.copyOf()" in that it creates a copy of the sim Simulator. entry state: ANY exit state: same as sim.state

Parameters:
sim -

reset

void reset()
Resets Simulator to initial (cleared) state. entry state: ANY exit state: INIT


restart

void restart()
Clears the current results to restart the Simulator with the original Algorithm and Asset (cleared of Performance and Price results). After restart(), simulate() or simulate(int) can be called. entry state: not INIT exit state: READY


getOptionSet

OptionSet getOptionSet()
Returns the OptionSet entry state: any exit state: unchanged

Returns:
OptionSet

getState

State getState()
Returns the current state entry state: any exit state: unchanged

Returns:
Price