Klasse RandomSimGenerator

java.lang.Object
net.simplace.sim.control.FWSimulationControlContainer
net.simplace.sim.control.FWSimulationGenerator
net.simplace.sim.control.generators.DefaultSimulationGenerator
net.simplace.sim.control.generators.RandomSimGenerator
Alle implementierten Schnittstellen:
net.simplace.sim.util.FWSimFieldContainer

public class RandomSimGenerator extends net.simplace.sim.control.generators.DefaultSimulationGenerator
Generate simulations with parameters created randomly from specified distributions. WIKI_START == Distributions == For each model variable the user can chose one of the distribution below: ||'''Distribution''' ||'''Distribution Parameters''' || ''Optional Param.''|| '''Return datatype''' || '''Remark''' || || Uniform || min, max || || DOUBLE || || || Normal || mean, sigma || min, max || DOUBLE || || || Exponential || lambda || min, max || DOUBLE || || || Poisson || lambda || min, max || INT || || || Binomial || n, p || min, max || INT || n has to be of type INT || || Choice || values || frequencies || any || Choses randomly a value from a list. Values have to be an array of the same type as the cal variable|| If min and max are specified and the generated value exceeds them, new random numbers are generated until one fits the interval. The number of trials is limited to `cMaxAttemptsOutOfRange`. If no number is found, the parameter set is skipped. Generated parameter sets can be further restricted by constraints. == Variable specific configuration == Arbitrary number of calibration variables (either `INT` or `DOUBLE`, depending on distribution used). When using the distribution `Choice`, then the datatype can be additionally `CHAR`, `DATE` or `BOOLEAN`. {{{ | }}} For each calibration variable the distribution and it's parametrization as in the table above. {{{ | | DISTRIBUTION | 3.0 | .5 | }}} == General configuration == || '''Name''' || '''DATATYPE''' || '''Description''' || || cCount || INT ||the number of parameter sets to be generated, mandatory || || cRandomSeed || CHAR ||optional random seed for the generator. Can be a long integer, therefore it has datatype CHAR || || cMaxAttemptsOutOfRange || INT ||maximum number of trials to re-generate a random number if it's value is outside min/max range|| A constraint prohibits the creation of invalid variable values. {{{ | }}} == Remark == The number of created simulations can be smaller than Count. - the min and max attributes of the generated values may prohibit generation of some parameter sets - an additional constraint on the parameter set may prevent generation of a simulation The random seed is set only on initialization of the generator. That means, that a subsequent iteration or a subsequent project can not set it's individual random seed. == Example == {{{ | | | | Uniform | 0 | | | | | Normal | | | 0 | | | | | Choice | {loam,sand,sandyloam} | {2,9,6} | | | 342345734 | 100 | | | | }}} WIKI_END
Autor:
Gunther Krauss
  • Feldübersicht

    Von Klasse geerbte Felder net.simplace.sim.control.FWSimulationGenerator

    iContentType, iSimulationsMap

    Von Klasse geerbte Felder net.simplace.sim.control.FWSimulationControlContainer

    iCache, iCals, iConstraint, iContainerElement, iControlMap, iFieldMap, iInputMap, iInputs, iName, iParams, iSession, iSimulationMap
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    RandomSimGenerator(org.jdom2.Element aGeneratorElement, net.simplace.sim.FWSimSession aSession, HashMap<String,net.simplace.sim.util.FWSimVariable<?>> aFieldMap, net.simplace.sim.util.FWSimVariable.CONTENT_TYPE aContentType)
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    HashMap<String,net.simplace.sim.util.FWSimVariable<?>>
     
    void
    generate(net.simplace.sim.control.FWSimulationControlCache aCache, ResultSet aResultSet)
     
    protected static int
    getIndex(double value, Double[] breaks)
    Return the index of the first break, that is bigger than the value.
    void
     
    protected static double
    nextRandom(Random randomizer, String distribution, double min, double max, double mean, double sigma, double lambda, double p, int n)
    Generates a next random number

    Von Klasse geerbte Methoden net.simplace.sim.control.FWSimulationGenerator

    addSimulation, canUpdate, clearSimulations, createSimulationGenerator, finalize, getSimulation, getSimulationsListSize, initializeProject, reset, setFinished, setInitial, updateSimulations, writeSimulation

    Von Klasse geerbte Methoden net.simplace.sim.control.FWSimulationControlContainer

    addProcessTime, addVariable, checkCondition, evaluate, getContentType, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getInputVariables, getName, getOrderNumber, getOutputVariables, getVariable, getVarMap, isConditionCheck, readInputCalAndConstraint, removeVariable, setPropertyValue, toXML

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • RandomSimGenerator

      public RandomSimGenerator(org.jdom2.Element aGeneratorElement, net.simplace.sim.FWSimSession aSession, HashMap<String,net.simplace.sim.util.FWSimVariable<?>> aFieldMap, net.simplace.sim.util.FWSimVariable.CONTENT_TYPE aContentType)
  • Methodendetails

    • init

      public void init()
      Setzt außer Kraft:
      init in Klasse net.simplace.sim.control.generators.DefaultSimulationGenerator
    • createVariables

      public HashMap<String,net.simplace.sim.util.FWSimVariable<?>> createVariables()
      Angegeben von:
      createVariables in Schnittstelle net.simplace.sim.util.FWSimFieldContainer
      Setzt außer Kraft:
      createVariables in Klasse net.simplace.sim.control.generators.DefaultSimulationGenerator
    • generate

      public void generate(net.simplace.sim.control.FWSimulationControlCache aCache, ResultSet aResultSet) throws SQLException
      Setzt außer Kraft:
      generate in Klasse net.simplace.sim.control.generators.DefaultSimulationGenerator
      Löst aus:
      SQLException
    • nextRandom

      protected static double nextRandom(Random randomizer, String distribution, double min, double max, double mean, double sigma, double lambda, double p, int n)
      Generates a next random number
      Parameter:
      randomizer -
      distribution -
      min -
      max -
      mean -
      sigma -
      lambda -
      p -
      n -
      Gibt zurück:
      random number
    • getIndex

      protected static int getIndex(double value, Double[] breaks)
      Return the index of the first break, that is bigger than the value.
      Parameter:
      value - a value between 0 and 1
      breaks - an array of ordered values between 0 and 1
      Gibt zurück:
      index