Code example for Random

Methods: setSeed

0
	/** 
	 * Sets the seed used by the internal random number generator. 
	 */ 
	public void setRandomSeed(long seed)
	{ 
		this.random.setSeed(seed);
	} 
	 
	/** 
	 * Retrieves an item with probability proportional to its weight in the 
	 * {@code Map} provided in the input. 
	 */ 
	public T nextItem() 
	{ 
		ItemPair item_pair = item_pairs.get(random.nextInt(item_pairs.size()));
		if (random.nextDouble() < item_pair.weight)
			return item_pair.light;
		return item_pair.heavy;
	} 
	 
	/**