org.ascape.util
Interface RandomFunctions

All Known Subinterfaces:
Space
All Known Implementing Classes:
Agent, AllOutputViewTest.TestAgent, Array, Array1D, Array2D, Array2DBase, Array2DEuclidian, Array2DMoore, Array2DSmallWorld, Array2DVonNeumann, AscapeObject, Cell, CellOccupant, CollectionSpace, CollectStats, Continuous1D, Continuous2D, Diffusion, Discrete, ExecuteThenUpdate, Globe, Graph, GraphSmallWorld, HostCell, ListBase, ListSpace, LocatedAgent, MapAgent, MomentumAgent, MoveRandomWithin, NotifyViews, NotifyViewsEvent, ParameterizedDiffusion, Propogate, PropogateScapeOnly, Rule, Scape, ScapeTime, SearchRule, SetValues, Singleton, SubCollection, SubContinuous, SubContinuous1D, SubContinuous2D, SubGraph, SubGraphAgent, SubListSpace

public interface RandomFunctions


Method Summary
 java.util.Random getRandom()
           
 double randomInRange(double low, double high)
          Generate a double uniformly distributed across some range.
 int randomInRange(int low, int high)
           
 boolean randomIs()
          Returns a random boolean value.
 int randomToLimit(int limit)
          Generate an integer uniformly distributed across 0...limit - 1.
 void setRandom(java.util.Random random)
           
 

Method Detail

randomInRange

int randomInRange(int low,
                  int high)

randomInRange

double randomInRange(double low,
                     double high)
Generate a double uniformly distributed across some range.

Parameters:
low - the lowest number (inclusive) that the resulting double might be
high - the hignest number (exclusive) that the resulting double might be
Returns:
uniformly distributed pseudorandom double

randomToLimit

int randomToLimit(int limit)
Generate an integer uniformly distributed across 0...limit - 1.

Parameters:
limit - the maximum limit (exclusive) of the resulting int
Returns:
uniformly distributed pseudorandom int

randomIs

boolean randomIs()
Returns a random boolean value.


getRandom

java.util.Random getRandom()

setRandom

void setRandom(java.util.Random random)


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.