Package microsim.alignment.probability
Class MultiplicativeScalingAlignment<T>
java.lang.Object
microsim.alignment.probability.MultiplicativeScalingAlignment<T>
- Type Parameters:
T
- A class usually representing an agent.
- All Implemented Interfaces:
AlignmentUtils<T>
A class for multiplicative scaling alignment method. All probabilities are extracted from the collection
agents
using provided filter
. Further steps involve calculation of the ration between the desired
transition rate and the actual transition to be used as a scaling factor for probabilities.- See Also:
-
- Jinjing Li and Cathal O'Donoghue, Evaluating Binary Alignment Methods in Microsimulation Models, Journal of Artificial Societies and Social Simulation 17 (1) 15
- Li, Jinjing and O'Donoghue, Cathal (2014) 'Evaluating Binary Alignment Methods in Microsimulation Models' Journal of Artificial Societies and Social Simulation 17 (1) 15
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble @NonNull []
align
(@NonNull Collection<T> agents, @Nullable org.apache.commons.collections4.Predicate<T> filter, @NonNull AlignmentProbabilityClosure<T> closure, double targetProbability) The main alignment method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface microsim.alignment.AlignmentUtils
extractAgentList, validateProbabilityValue
-
Constructor Details
-
MultiplicativeScalingAlignment
public MultiplicativeScalingAlignment()
-
-
Method Details
-
align
public double @NonNull [] align(@NonNull @NonNull Collection<T> agents, @Nullable @Nullable org.apache.commons.collections4.Predicate<T> filter, @NonNull @NonNull AlignmentProbabilityClosure<T> closure, double targetProbability) The main alignment method. It involves scaling the existing probabilities by multiplying by a factor. Its value is the target probability divided by the sum of all initial probabilities. The resulting values then are compared to a random number from the(0, 1)
range to decide if the transition happens.- Parameters:
agents
- An unfiltered collection of agents.filter
- A logical filter for agents, can benull
.closure
- A closure to handle probabilities of agents.targetProbability
- The target probability value.- Returns:
- The corrected set of outcomes.
- Throws:
NullPointerException
- whenagents
, orclosure
, or both arenull
.
-