Пример #1
0
 /*Give an even portion of the agent's goods to all the children*/
 private void omniBequeath(Human man) {
   if (man.children.size() == 0) {
     // std::cout<<"Childless ";
     /*TODO remove holdings from model*/
   } else {
     if (man.children.size() > 1) {
       Model.instance().addToWealthRedistributed(man.getWealth());
       Model.instance().incrementOmniEvent();
     }
     for (int i = 0; i < man.children.size(); i++) {
       for (int j = 0; j < Commodity.NUM_COMM; j++) {
         double progeny = man.children.size();
         man.children.get(i).commoditiesHeld[j] += man.commoditiesHeld[j] / progeny;
         man.children.get(i).money += man.money / progeny;
       }
     }
   }
 }