static void Main(string[] args) { EcoAgent[] agentArray = new EcoAgent[11]; for (int i = 0; i < agentArray.Length; i++) { agentArray[i] = new EcoAgent(); agentArray[i].ID = i; agentArray[i].cash = 100; agentArray[i].labour = 100; agentArray[i].food = 100; if (i <= 5) { agentArray[i].setup_agent(0); } else { agentArray[i].setup_agent(1); } agentArray[i].global_setup(agentArray.Length); } gameLoop(agentArray); }
//globaldata[output type, price per quantity, quantity available] public void output_update(int agent_number, EcoAgent foreign_agents) { //column 0 - OutputType global_data[0, agent_number] = foreign_agents.output; //column 1 - Price Per Quantity global_data[1, agent_number] = 1 + GetRandomNumber(-0.04, 0.05); //column 2 - Quantity available global_data[2, agent_number] = global_data[2, agent_number] + foreign_agents.stockpile; }