Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uchicago.src.sim.util
Class AgentDistribution

    java.lang.Object
      uchicago.src.sim.util.AgentDistribution

    public class AgentDistribution

extends java.lang.Object

This is a helper class designed to apply random numbers generated using a statistical distribution to a particular variable in your Agent Set. The random numbers are generated from classes contained in the cern.jet.random package. Examples include chi-squared, normal, and pareto. This class can be used in conjunction with the uchicago.src.sim.util.DistributionFactory to quickly apply a distribution to agents.

Version:
  $Revision: 1.6 $ $Date: 2004/11/03 19:51:06 $
Author:
  $Author: jerryvos $
See Also:
  `cern.jet.random`, `DistributionFactory`

Constructor Summary
`AgentDistribution(cern.jet.random.AbstractDistribution d, java.util.ArrayList agents, java.lang.String var)` Constructs an AgentDistribution usin the distribution, the agent list and variable name.

Method Summary
`java.util.ArrayList` | `distributeAgents()` Sets the chosen variable in the agents to a random number generated using the distribution.
`java.util.ArrayList` | `getAgents()`
`cern.jet.random.AbstractDistribution` | `getDistribution()`
`java.lang.String` | `getVar()`
`void` | `setAgents(java.util.ArrayList agents)`
`void` | `setDistribution(cern.jet.random.AbstractDistribution d)`
`void` | `setVar(java.lang.String var)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AgentDistribution

    public AgentDistribution(cern.jet.random.AbstractDistribution d,
                             java.util.ArrayList agents,
                             java.lang.String var)

  Constructs an AgentDistribution usin the distribution, the agent list and variable name.

  Parameters:
    `d` - The distribution to use when generating random numbers.
    `agents` - The agents
    `var` - The name of the variable you want to set.

Method Detail

### setDistribution

    public void setDistribution(cern.jet.random.AbstractDistribution d)

### getDistribution

    public cern.jet.random.AbstractDistribution getDistribution()

### setAgents

    public void setAgents(java.util.ArrayList agents)

### getAgents

    public java.util.ArrayList getAgents()

### setVar

    public void setVar(java.lang.String var)

### getVar

    public java.lang.String getVar()

### distributeAgents

    public java.util.ArrayList distributeAgents()
                                         throws java.lang.reflect.InvocationTargetException,
                                                java.lang.IllegalAccessException

  Sets the chosen variable in the agents to a random number generated using the distribution.

  Throws:
    `java.lang.reflect.InvocationTargetException`
    `java.lang.IllegalAccessException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD