Commits

littledot5566 committed 6460055

Fixed from using the same agent list to generate a copy of the same agent list.

Comments (0)

Files changed (3)

src/sim/Main.java

 
 		// ShengDean static sim
 		for (int i = 0; i < 1; i++) {
-			System.err.println("STATIC" + i);
+
 			StaticSimulation ss = new StaticSimulation(
 					tasks,
 					_agents,
 					avgPay);
-			ss.run();
-			ss.chart();
 
 			// ShengDean dynamic sim
-			System.err.println("DYNAMIC" + i);
+
 			DynamicSimulation ds = new DynamicSimulation(
 					tasks,
 					_agents,
 					minPay, maxPay, avgPay);
+			System.err.println("STATIC" + i);
+			ss.run();
+			ss.chart();
+			System.err.println("DYNAMIC" + i);
 			ds.run();
 			ds.report();
 			ds.chart();

src/sim/shengdean/DynamicSimulation.java

 		_avgPay = avgPay;
 
 		// generate agents
-		_agents.addAll(agents);
+		for (Agent agent : agents) {
+			Agent copy = new Agent(agent._id, agent._mean, agent._variance);
+			_agents.add(copy);
+		}
 
 		// generate tasks
 		for (int i = 0; i < tasks; i++) {

src/sim/shengdean/StaticSimulation.java

 		_basePay = pay;
 
 		// generate agents
-		_agents.addAll(agents);
+		for (Agent agent : agents) {
+			Agent copy = new Agent(agent._id, agent._mean, agent._variance);
+			_agents.add(copy);
+		}
 
 		// generate tasks
 		for (int i = 0; i < tasks; i++) {