title: can I would like to make a multiple iteration with a single loop Anylogic
body: <p>I would like to make these multiple iterations in one single loop, but I don't know how it works.
  I'm reading the database of daily demand and sending it to the wholesaler agent if the demand is greater than the current stock of the retailer.</p>
  <pre><code>// read demand from DBs that send orders to wholesaler1
  int today = 1;
  retailers(0).dailyDemand = (int) selectFrom(ddr1)
      .where(ddr1.day.eq(today))
      .firstResult(ddr1.demand);
  wholesaler1.retailersDemand = retailers(0).dailyDemand;     
  retailers(1).dailyDemand = (int) selectFrom(ddr2)
      .where(ddr2.day.eq(today))
      .firstResult(ddr2.demand);
  wholesaler1.retailersDemand = retailers(1).dailyDemand; 
  retailers(2).dailyDemand = (int) selectFrom(ddr3)
      .where(ddr3.day.eq(today))
      .firstResult(ddr3.demand);
  wholesaler1.retailersDemand = retailers(2).dailyDemand;
  retailers(3).dailyDemand = (int) selectFrom(ddr4)
      .where(ddr4.day.eq(today))
      .firstResult(ddr4.demand);
  wholesaler1.retailersDemand = retailers(3).dailyDemand; 
  retailers(4).dailyDemand = (int) selectFrom(ddr5)
      .where(ddr5.day.eq(today))
      .firstResult(ddr5.demand);
  wholesaler1.retailersDemand = retailers(4).dailyDemand; 
  // read demand from DBs that send orders to wholesaler2
  wholesaler2.retailersDemand = retailers(5).dailyDemand; 
  retailers(5).dailyDemand = (int) selectFrom(ddr6)
      .where(ddr6.day.eq(today))
      .firstResult(ddr6.demand);
  wholesaler2.retailersDemand = retailers(5).dailyDemand; 
  today++;
  </code></pre>
  <p>the screenshot illustrates what I mean
  <a href="https://i.stack.imgur.com/R38X1.png" rel="nofollow noreferrer">Code</a>
  <a href="https://i.stack.imgur.com/Gekvf.png" rel="nofollow noreferrer">Agents List</a></p>