mercredi 4 avril 2018

Random generation in Java [duplicate]

This question already has an answer here:

Is there a method like the rng.randint() in the code below for Java?

Are Math.random() o java.util.Random viable for this aim?

  ...  

  rng.seed(random_seed)

  child1, child2 = parents

  const1 = child1.const_set
  const2 = child2.const_set

  cp1 = rng.randint(1, len(const1) - 1) if len(const1) > 1 else 0
  cp2 = rng.randint(1, len(const2) - 1) if len(const2) > 1 else 0




Aucun commentaire:

Enregistrer un commentaire