Class AbstractProbabilityAlignment<T>

java.lang.Object
microsim.alignment.probability.AbstractProbabilityAlignment<T>
Type Parameters:
T - - the Type parameter usually representing the agent class.
Direct Known Subclasses:
LogitScalingBinaryAlignment, LogitScalingBinaryWeightedAlignment, MultiplicativeScalingAlignment, SBDAlignment, SBDLAlignment, SidewalkAlignment

public abstract class AbstractProbabilityAlignment<T> extends Object
Abstract class for BINARY PROBABILITY alignment methods (for Binary outcome alignment, see microsim.alignment.outcome package; for Multiple choice probability alignment, see microsim.alignment.multi package). Acknowledgements: Partly based on "Evaluating Binary Alignment Methods in Microsimulation Models", by Jinjing Li and Cathal O'Donoghue, Journal of Artificial Societies and Social Simulation, 2014 (http://jasss.soc.surrey.ac.uk/17/1/15/15.pdf) General principle of operation of this class: a) Some variable is defined for the agents (the variable can be a probability or an outcome). b) Alignment is called to modify that variable, possibly making use of a specific process of the agents. ALIGNMENT OF PROBABILITIES: this requires a process is specified that computes individual probabilities of the occurrence of a given event. Alignment is then called to modify those probabilities. A second process is specified to determine the occurrence of the event given the (modified) probabilities.
Author:
Matteo Richiardi This version: July 2014
  • Constructor Details

    • AbstractProbabilityAlignment

      public AbstractProbabilityAlignment()
  • Method Details

    • align

      public abstract void align(Collection<T> agents, org.apache.commons.collections4.Predicate<T> filter, AlignmentProbabilityClosure<T> closure, double targetShare)
      Method to implement alignment.
      Parameters:
      agents - - a collection of agents to potentially be aligned
      filter - - filters the agentList so that only the relevant sub-population of agents is aligned
      closure - - specifies the method returning the unaligned probability of the positive outcome for the agent and the method that samples the aligned probabilities to specify the outcome.
      targetShare - - a target share of the relevant sub-population (specified as a proportion of the filtered population) for which the outcome (defined by the AlignmentProbabilityClosure) must be true.
    • sortByComparator

      protected Map<T,Double> sortByComparator(Map<T,Double> unsortedMap, boolean ascendingOrder)
      Sorting of objects of type T (usually the agents) by an associated Double number. This method is used in the SBD and SBDL alignment algorithms.
      Parameters:
      unsortedMap -
      ascendingOrder - - if true, the method returns a map ordered by the Double value increasing, otherwise the map will be ordered by the Double value decreasing.
      Returns:
      - the map of type T objects sorted by the Double numbers.