/* Author: Jeff Dalton * Updated: Wed Dec 5 00:56:32 2001 by Jeff Dalton * Copyright: (c) 2001, AIAI, University of Edinburgh */ package ix.ideel; import java.util.*; import ix.iface.domain.DomainParser; import ix.icore.domain.Domain; import ix.icore.Issue; import ix.icore.BasicIssueHandler; import ix.icore.Report; import ix.util.*; import ix.util.lisp.*; /** * The CoAX I-DEEL class and application main program. */ public class I_DEEL extends BasicIdeel { public I_DEEL() { super(); // Change some defaults displayName = "Chief of Combat Operations"; symbolName = "CCO"; logoLine1 = "I-DEEL: I-X Dynamic Event and Execution List"; logoLine2 = "Based on I-X Technology"; logoImage = "images/ip2-logo.gif"; domainName = "binni-ideel.xml"; } /** * Main program. */ public static void main(String[] argv) { Util.printGreeting("I-DEEL"); new I_DEEL().mainStartup(argv); } /** * Called to add items to the main frame menu bar's "Test" menu. */ protected void addTestMenuItems() { frame.addTestIssue(PRIORITY_HIGH, "avoid elephants laki_safari_park"); } /** * Install I-DEEL's own issue handlers for issues it can * handle automatically. */ protected void addIdeelIssueHandlers() { // We Don't want to inherit any handlers. // super.addIdeelIssueHandlers(); controller.addIssueHandler ("report", // Want to be able to say "report to " /\/ new IdeelIssueHandler("report to JTFC/ILEED") { public void handleIssue(Issue i) { String text = Lisp.elementsToString((LList)i.getParameters()); Report report = new Report(text); report.getProperties().put("sender-id", getAgentIPCName()); IPC.sendObject(// i.getProperties().get("sender-id"), "ILEED", report); i.setStatus(STATUS_COMPLETE); } }); controller.addIssueHandler ("deconflict_plans", new IdeelIssueHandler("invoke deconfliction agent") { public void handleIssue(Issue i) { // Here's where we'd send a request to // the deconfliction agent. // /\/: Probably it would not become complete // until we got a report back. i.setStatus(STATUS_EXECUTING); } public void addIssueOptions(IdeelIssue i) { // First do what we normally do, namely add the option(s). super.addIssueOptions(i); // Now this gives us a chance to give the issue // the required "reportRef" field. /\/ String ref = "MCA-IDEEL-1"; Debug.noteln("Setting reportRef of " + i + " to " + Util.quote(ref)); i.reportRef = ref; } }); } } // Issues: // * Will we always know where a report should go, or do we need a way // to ask the user?