Пример #1
0
 /**
  * Return a random GlobalAttributeValueId
  *
  * @return
  */
 public GlobalAttributeValueId getRandomGlobalAttributeValue() {
   int offset = rng.nextInt(this.gag_ids.size());
   GlobalAttributeGroupId gag_id = this.gag_ids.get(offset);
   assert (gag_id != null);
   int count = rng.nextInt(gag_id.getCount());
   GlobalAttributeValueId gav_id = new GlobalAttributeValueId(gag_id, count);
   return gav_id;
 }
Пример #2
0
 public ItemInfo getRandomItem() {
   assert (this.getAllItemsCount() > 0);
   int idx = -1;
   while (idx == -1 || allItemSets[idx].isEmpty()) {
     idx = rng.nextInt(allItemSets.length);
   } // WHILE
   return (this.getRandomItem(allItemSets[idx], false, false));
 }