Class DiscreteEffects
java.lang.Object
gov.nasa.jpl.aerie.contrib.streamline.modeling.discrete.DiscreteEffects
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidadd(MutableResource<Discrete<List<T>>> resource, T element) Add element to the end of the queue resourcestatic voidconsume(MutableResource<Discrete<Double>> resource, double amount) Subtract the given amount from resource.static voidSubtract the given amount from resource.static voiddecrease(MutableResource<Discrete<Double>> resource, double amount) Subtract amount from resource's valuestatic voiddecrement(MutableResource<Discrete<Integer>> resource) Subtract one from the resource's value.static voiddecrement(MutableResource<Discrete<Integer>> resource, int amount) Subtract the given amount from the resource's value.static voidincrease(MutableResource<Discrete<Double>> resource, double amount) Add amount to resource's valuestatic voidincrement(MutableResource<Discrete<Integer>> resource) Add one to the resource's value.static voidincrement(MutableResource<Discrete<Integer>> resource, int amount) Add the given amount to the resource's value.static <T> Optional<T> remove(MutableResource<Discrete<List<T>>> resource) Remove an element from the front of the queue resource.static voidrestore(MutableResource<Discrete<Double>> resource, double amount) Add the given amount to resource.static voidAdd the given amount to resource.static <A> voidset(MutableResource<Discrete<A>> resource, A newValue) Set the resource to the given value.static <A> voidset(UnitAware<MutableResource<Discrete<A>>> resource, UnitAware<A> newValue) Set the resource to the given value.static voidtoggle(MutableResource<Discrete<Boolean>> resource) Toggle the resource value.static voidturnOff(MutableResource<Discrete<Boolean>> resource) Set the resource to false.static voidturnOn(MutableResource<Discrete<Boolean>> resource) Set the resource to true.static voidusing(MutableResource<Discrete<Double>> resource, double amount, Runnable action) Decrease resource by amount while action is running.static voidusing(MutableResource<Discrete<Integer>> resource, Runnable action) Decrease resource by one while action is running.static voidusing(UnitAware<MutableResource<Discrete<Double>>> resource, UnitAware<Double> amount, Runnable action) Decrease resource by amount while action is running.
-
Method Details
-
set
Set the resource to the given value. -
turnOn
Set the resource to true. -
turnOff
Set the resource to false. -
toggle
Toggle the resource value. -
increment
Add one to the resource's value. -
increment
Add the given amount to the resource's value. -
decrement
Subtract one from the resource's value. -
decrement
Subtract the given amount from the resource's value. -
increase
Add amount to resource's value -
decrease
Subtract amount from resource's value -
add
Add element to the end of the queue resource -
remove
Remove an element from the front of the queue resource.Returns that element, or empty if the queue was already empty.
-
consume
Subtract the given amount from resource. -
restore
Add the given amount to resource. -
using
public static void using(MutableResource<Discrete<Double>> resource, double amount, Runnable action) Decrease resource by amount while action is running. -
using
Decrease resource by one while action is running. -
set
Set the resource to the given value. -
consume
public static void consume(UnitAware<MutableResource<Discrete<Double>>> resource, UnitAware<Double> amount) Subtract the given amount from resource. -
restore
public static void restore(UnitAware<MutableResource<Discrete<Double>>> resource, UnitAware<Double> amount) Add the given amount to resource. -
using
public static void using(UnitAware<MutableResource<Discrete<Double>>> resource, UnitAware<Double> amount, Runnable action) Decrease resource by amount while action is running.
-