Class DisasterType
- java.lang.Object
-
- jadex.bdiv3.examples.disastermanagement.DisasterType
-
public class DisasterType extends java.lang.ObjectHelper class for random disaster generation.
-
-
Field Summary
Fields Modifier and Type Field Description protected doublechemicalsThe average chemical number, relative to size (0 = off).static DisasterType[]DISASTER_TYPESThe disaster types.protected doublefireThe average fire number, relative to size (0 = off).protected java.lang.StringnameThe type name.protected doubleoccurrenceThe occurrence probability.protected static java.util.RandomrandomThe random number generator.protected doublesevereThe severity probability.protected int[]sizeThe size range [min, max].protected doublevictimsThe average victims number, relative to size (0 = off).
-
Constructor Summary
Constructors Constructor Description DisasterType(java.lang.String name, double occurrence, double severe, int[] size, double victims, double fire, double chemicals)Create a new disaster type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.MapgenerateDisaster()doublegetChemicals()Get the name.static IVector2getChemicalsLocation(ISpaceObject disaster)Get the position of chemicals at the given disaster.static IVector2getEarthquakeIncidentLocation(ISpaceObject disaster)Get the position of an incident at the given earthquake.static doublegetExponentialSample(double mean)Get an exponential sample value.doublegetFire()Get the name.static IVector2getFireLocation(ISpaceObject disaster)Get the position of a fire at the given disaster.java.lang.StringgetName()Get the name.doublegetOccurrence()Get the occurrence probability.doublegetSevere()Get the severity probability.int[]getSize()Get the name.static IVector2getVictimLocation(ISpaceObject disaster)Get the position of a victim at the given disaster.doublegetVictims()Get the name.
-
-
-
Field Detail
-
DISASTER_TYPES
public static final DisasterType[] DISASTER_TYPES
The disaster types.
-
random
protected static final java.util.Random random
The random number generator.
-
name
protected java.lang.String name
The type name.
-
occurrence
protected double occurrence
The occurrence probability.
-
severe
protected double severe
The severity probability.
-
size
protected int[] size
The size range [min, max].
-
victims
protected double victims
The average victims number, relative to size (0 = off).
-
fire
protected double fire
The average fire number, relative to size (0 = off).
-
chemicals
protected double chemicals
The average chemical number, relative to size (0 = off).
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name.
-
getOccurrence
public double getOccurrence()
Get the occurrence probability.
-
getSevere
public double getSevere()
Get the severity probability.
-
getSize
public int[] getSize()
Get the name.
-
getVictims
public double getVictims()
Get the name.
-
getFire
public double getFire()
Get the name.
-
getChemicals
public double getChemicals()
Get the name.
-
generateDisaster
public static java.util.Map generateDisaster()
-
getFireLocation
public static IVector2 getFireLocation(ISpaceObject disaster)
Get the position of a fire at the given disaster.
-
getChemicalsLocation
public static IVector2 getChemicalsLocation(ISpaceObject disaster)
Get the position of chemicals at the given disaster.
-
getVictimLocation
public static IVector2 getVictimLocation(ISpaceObject disaster)
Get the position of a victim at the given disaster.
-
getEarthquakeIncidentLocation
public static IVector2 getEarthquakeIncidentLocation(ISpaceObject disaster)
Get the position of an incident at the given earthquake.
-
getExponentialSample
public static double getExponentialSample(double mean)
Get an exponential sample value.
-
-