Commits

littledot5566  committed 486681d Merge
  • Participants
  • Parent commits 6460055, 727d9c4

Comments (0)

Files changed (2)

File src/sim/Main.java

 public class Main {
 
 	public static int tasks = 10000;
-	public static int agents = 50;
+	public static int agents = 5;
 	public static double avgPay = 50;
 	public static double minPay = 20;
 	public static double maxPay = 60;

File src/sim/shengdean/Charter.java

 			}
 
 			// compare avg quality and mean quality
-			qaData.addValue(totalQA / agent._completed.size(), "Avg Quality", ""
-					+ i);
+			qaData.addValue(totalQA / agent._completed.size(), "Avg Quality", "" + i);
 			qaData.addValue(agent._mean, "Expected Avg Quality", "" + i);
 		}
 
-		JFreeChart chart = ChartFactory.createBarChart(
-				"Quality Chart",         // chart title
-				"Agent ID",               // domain axis label
-				"Quality",                  // range axis label
-				qaData,                  		// data
+		JFreeChart chart = ChartFactory.createBarChart("Quality Chart", // chart
+																																		// title
+				"Agent ID", // domain axis label
+				"Quality", // range axis label
+				qaData, // data
 				PlotOrientation.VERTICAL, // orientation
-				true,                     // include legend
-				true,                     // tooltips?
-				false                     // URLs?
+				true, // include legend
+				true, // tooltips?
+				false // URLs?
 				);
 
 		CategoryPlot plot = chart.getCategoryPlot();
 			payData.addValue(totalPay, "Total Pay", "" + i);
 		}
 
-		JFreeChart payChart = ChartFactory.createBarChart(
-				"Work Chart",         			// chart title
-				"Agent ID",               // domain axis label
-				"$",                  // range axis label
-				payData,                  		// data
+		JFreeChart payChart = ChartFactory.createBarChart("Work Chart", // chart
+																																		// title
+				"Agent ID", // domain axis label
+				"$", // range axis label
+				payData, // data
 				PlotOrientation.VERTICAL, // orientation
-				true,                     // include legend
-				true,                     // tooltips?
-				false                     // URLs?
+				true, // include legend
+				true, // tooltips?
+				false // URLs?
 				);
 
 		CategoryPlot plot = payChart.getCategoryPlot();
 		DefaultCategoryDataset dataset = new DefaultCategoryDataset();
 
 		for (int i = 0; i < agents.size(); i++) {
-			// if (i == 0 || i == 25 || i == 49) {
-			ArrayList<Double> scores = agents.get(i)._pastScore;
+			if (i == 0 || i == (agents.size() / 2) || i == (agents.size() - 1)) {
+				ArrayList<Double> scores = agents.get(i)._pastScore;
 
-			for (int j = 0; j < scores.size(); j++) {
-				dataset.addValue(scores.get(j), "" + i, "" + j);
+				for (int j = 0; j < scores.size(); j++) {
+					dataset.addValue(scores.get(j), "" + i, "" + j);
+				}
 			}
-			// }
 		}
 
-		JFreeChart chart = ChartFactory.createLineChart(
-				"Score Chart",       // chart title
-				"Task no.",                    // domain axis label
-				"Score",                   // range axis label
-				dataset,                   // data
-				PlotOrientation.VERTICAL,  // orientation
-				true,                      // include legend
-				true,                      // tooltips
-				false                      // urls
+		JFreeChart chart = ChartFactory.createLineChart("Score Chart", // chart
+																																		// title
+				"Task no.", // domain axis label
+				"Score", // range axis label
+				dataset, // data
+				PlotOrientation.VERTICAL, // orientation
+				true, // include legend
+				true, // tooltips
+				false // urls
 				);
 
 		ChartFrame frame = new ChartFrame("", chart);