Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1022932 // RandomAndVary_Double

JavaX fragment (include)

sclass RandomAndVary_Double implements RandomAndVary<Double> {
  double min = 0, max = 1, varyFactor = 0.1;
  
  public Double randomInstance() { ret random(min, max); }
  public Double varyInstance(Double a) {
    ret clipDouble(min, max, a+(max-min)*varyFactor);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022932
Snippet name: RandomAndVary_Double
Eternal ID of this version: #1022932/2
Text MD5: dd858d7bdc2c3c2ab872b30e71cbed48
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-14 23:19:13
Source code size: 277 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 229 / 643
Version history: 1 change(s)
Referenced in: [show references]