functionalAgentNames.add(QualifiedName.make(moduleName, "makeEmptyRoom"));
functionalAgentNames.add(QualifiedName.make(moduleName, "Red"));
functionalAgentNames.add(QualifiedName.make(moduleName, "Yellow"));
functionalAgentNames.add(QualifiedName.make(moduleName, "Blue"));
CALExecutor executor = calServices.getWorkspaceManager().makeExecutorWithNewContextAndDefaultProperties();
entryPoints = compiler.getEntryPoints(EntryPointSpec.buildListFromQualifiedNames(functionalAgentNames),
moduleName, messageLogger);
if (messageLogger.getNMessages() > 0) {
System.err.println(messageLogger.toString());
System.exit(1);
}
stopWatch.stop();
System.err.println("Startup took: " + stopWatch);
try {
stopWatch.start();
CalMonitor meetingRoom = (CalMonitor) executor.exec(entryPoints.get(1), new Object[] { new Integer(numberOfMeetings) });
CalMonitor occupant = new CalMonitor();
Object red = executor.exec(entryPoints.get(2), null);
Object yellow = executor.exec(entryPoints.get(3), null);
Object blue = executor.exec(entryPoints.get(4), null);
//start the three chameneos, each with a different colors
ChameneosThread t1 = ChameneosThread.makeChameneosThread(entryPoints.get(0), red, meetingRoom, occupant);
ChameneosThread t2 = ChameneosThread.makeChameneosThread(entryPoints.get(0), yellow, meetingRoom, occupant);
ChameneosThread t3 = ChameneosThread.makeChameneosThread(entryPoints.get(0), blue, meetingRoom, occupant);