DoubleNumber

DoubleNumber

Generates 64bit floating point values between min and max with specified number of decimal places. Range: [minD, maxD[, if minD=1.0 and maxD=2.0 generator may produce 1.9999999999 but never 2.0, except due to rounding (e.g. with: HALF_EVEN or decimalPlaces)

Attributes
Name Description Required Min Max Allowed Values
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
minD Content type: Double
Minimal output value (inclusive) of this generator. Range: [minD, maxD[, if minD=1.0 and maxD=2.0 generator may produce 1.9999999999 but never 2.0, except due to rounding (e.g. with: HALF_EVEN or decimalPlaces)
yes 1 1
format Content type: String
A format string describing how to format the number. Supported are class java.text.DecimalFormat (e.g. '#.000') and class java.util.Formatter (printf() sytle e.g.: '%.3d') syntax. If the format string contains a '%' symbol: first try to interpret format as Formatter style, with fall back to DecimalFormat. Else interpret format as DecimalFormat style with fall back to Formatter. Example: '%.3d' to format the number with 3 decimal places
Default: Unset (do not apply any special formatting to the number)
no 0 1
distribution Distribution to be used by a generator when calculating a value no 0 1
  • bankmark.pdgf.distribution.Logarithmic
  • bankmark.pdgf.distribution.Beta
  • bankmark.pdgf.distribution.Normal
  • bankmark.pdgf.distribution.Exponential
  • bankmark.pdgf.distribution.Zeta
  • bankmark.pdgf.distribution.Binomial
maxD Content type: Double
Maximal output value (exclusive) of this generator. Range: [minD, maxD[, if minD=1.0 and maxD=2.0 generator may produce 1.9999999999 but never 2.0, except due to rounding (e.g. with: HALF_EVEN or decimalPlaces)
yes 1 1
distinct Content type: Long
Number of distinct values (< 1 = deactivated) Note: min and max are always part of the distinct values.
Example:
<minD>1.0</minD>
<maxD>10.0</maxD>
<distinct>3</distinct>
might generate only the three distinct values 1.0, 5.0 and 10.0 as result.
Default: 0
no 0 1
locale Content type: String
Locale to use. A locale defines the formatting rules for numbers, e.g what symbol to use as the decimal point and the thousand separator.
Examples: 'en-US', 'en-GB'. 'de-DE'
'Default is: 'us'
no 0 1
  • ar
  • ar-AE
  • ar-BH
  • ar-DZ
  • ar-EG
  • ar-IQ
  • ar-JO
  • ar-KW
  • ar-LB
  • ar-LY
  • ar-MA
  • ar-OM
  • ar-QA
  • ar-SA
  • ar-SD
  • ar-SY
  • ar-TN
  • ar-YE
  • be
  • be-BY
  • bg
  • bg-BG
  • ca
  • ca-ES
  • cs
  • cs-CZ
  • da
  • da-DK
  • de
  • de-AT
  • de-CH
  • de-DE
  • de-GR
  • de-LU
  • el
  • el-CY
  • el-GR
  • en
  • en-AU
  • en-CA
  • en-GB
  • en-IE
  • en-IN
  • en-MT
  • en-NZ
  • en-PH
  • en-SG
  • en-US
  • en-ZA
  • es
  • es-AR
  • es-BO
  • es-CL
  • es-CO
  • es-CR
  • es-CU
  • es-DO
  • es-EC
  • es-ES
  • es-GT
  • es-HN
  • es-MX
  • es-NI
  • es-PA
  • es-PE
  • es-PR
  • es-PY
  • es-SV
  • es-US
  • es-UY
  • es-VE
  • et
  • et-EE
  • fi
  • fi-FI
  • fr
  • fr-BE
  • fr-CA
  • fr-CH
  • fr-FR
  • fr-LU
  • ga
  • ga-IE
  • he
  • he-IL
  • hi
  • hi-IN
  • hr
  • hr-HR
  • hu
  • hu-HU
  • id
  • id-ID
  • is
  • is-IS
  • it
  • it-CH
  • it-IT
  • ja
  • ja-JP
  • ja-JP-u-ca-japanese-x-lvariant-JP
  • ko
  • ko-KR
  • lt
  • lt-LT
  • lv
  • lv-LV
  • mk
  • mk-MK
  • ms
  • ms-MY
  • mt
  • mt-MT
  • nl
  • nl-BE
  • nl-NL
  • nn-NO
  • no
  • no-NO
  • pl
  • pl-PL
  • pt
  • pt-BR
  • pt-PT
  • ro
  • ro-RO
  • ru
  • ru-RU
  • sk
  • sk-SK
  • sl
  • sl-SI
  • sq
  • sq-AL
  • sr
  • sr-BA
  • sr-CS
  • sr-Latn
  • sr-Latn-BA
  • sr-Latn-ME
  • sr-Latn-RS
  • sr-ME
  • sr-RS
  • sv
  • sv-SE
  • th
  • th-TH
  • th-TH-u-nu-thai-x-lvariant-TH
  • tr
  • tr-TR
  • uk
  • uk-UA
  • und
  • vi
  • vi-VN
  • zh
  • zh-CN
  • zh-HK
  • zh-SG
  • zh-TW
decimalPlaces Content type: Integer
Used to specify the precision of the calculation result.
Example: calculation raw result 3.644345345;
decimalPlaces<0: result -> 3.644345345 //unmodified (default)
decimalPlaces=2: result -> 3.64
decimalPlaces=3: result -> 3.642
decimalPlaces=36 <-max precision
Default: -1
no 0 1
Sub-Attributes
Parent Name Description Required Min Max Allowed Values
decimalPlaces roundingMode Content type: String
Sets the rounding mode used to round numbers.
Default: HALF_EVEN
Possible values: [UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN, UNNECESSARY]
no 0 1
  • UP
  • DOWN
  • CEILING
  • FLOOR
  • HALF_UP
  • HALF_DOWN
  • HALF_EVEN
  • UNNECESSARY
decimalPlaces roundPlainValue Content type: Boolean
Round generated raw value to specified 'decimalPlaces'
If true : other generators will work with the rounded value.
If false: still round the value during 'toString()' but retain full precision for other generators using this generator's output, e.g., by reference or another computational generator.
Only available if 'decimalPlaces' parameter is >=0.
Default: true
no 0 1
  • true
  • false
  • 0
  • 1
Sub-Parameters
Parent Name Description Required Min Max Allowed Values
minD gen Value Generator for this field no 0 1
maxD gen Value Generator for this field no 0 1
distinct gen Value Generator for this field no 0 1

Examples

  1. Random Floating Point

    Generates a random floating point number within the specified range (inclusive) [0.0 .. 1.0].

    Schema config for Random Floating Point
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="DOUBLES">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random Floating Point-->
          <!--
            Generates a random floating point number within the specified range (inclusive) [0.0 .. 1.0].
          -->
          <field name="random_double" size="" type="DOUBLE">
            <gen_DoubleNumber>
              <minD>0</minD>
              <maxD>1</maxD>
            </gen_DoubleNumber>
        </field>
        </table>
    </schema>
    
    Output for Random Floating Point
    0.8634441417517924
    0.09040092885859097
    0.5056401480557208
    0.3645078737291703
    0.9253159258438133
    0.8328493689478823
    0.8702878241862981
    0.3291537926903023
    0.1694385799544142
    0.11054569088249089
  2. Random Formatted Floating Point

    Generates a random floating point number rounded to the one decimal place from [0.0 .. 1.0]

    Schema config for Random Formatted Floating Point
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="DOUBLES">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random Formatted Floating Point-->
          <!--Generates a random floating point number rounded to the one decimal place from [0.0 .. 1.0]-->
          <field name="random_double_fmt" size="" type="DOUBLE">
            <gen_DoubleNumber>
              <minD>0</minD>
              <maxD>1</maxD>
              <decimalPlaces>1</decimalPlaces>
            </gen_DoubleNumber>
          </field>
          </table>
    </schema>
    
    Output for Random Formatted Floating Point
    0.9
    0.0
    0.1
    0.1
    0.8
    1.0
    0.6
    0.7
    0.7
    0.3
  3. Random Distinct Formatted Floating Point

    Generates three distinct, formatted (rounded to one decimal place) floating numbers.

    Schema config for Random Distinct Formatted Floating Point
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="DOUBLES">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random Distinct Formatted Floating Point-->
          <!--Generates three distinct, formatted (rounded to one decimal place) floating numbers.-->
          <field name="random_double_fmt_dist" size="" type="DOUBLE">
            <gen_DoubleNumber>
              <minD>1</minD>
              <maxD>10</maxD>
              <distinct>3</distinct>
              <decimalPlaces>1</decimalPlaces>
            </gen_DoubleNumber>
          </field>
          </table>
    </schema>
    
    Output for Random Distinct Formatted Floating Point
    3.0
    3.0
    7.4
    3.0
    2.7
    7.4
    7.4
    2.7
    2.7
    2.7
2.7-83fb0 | 2020-04-22