Changes in Version 1.1 --------------------------------------------------------- Short Version -------------------------------------------------------- Bug fixes: Fixed bug causing S.race not to clean up properly when sendSignalLocal was being called Fixed two bugs that could cause a race condition in the Signal processor when using waitForSignal, and waitForSignalQueue Fixed a bug that caused SignalWautQueues to not work properly when using the SimulationClock Fixed setting the real time factor during a simulation run Fixed output going to the logfile, which could be garbled before Fixed exception that could occur when using S.sendSignalGlobal Fixed findOmarNodes in GridHelper, which wasnt finding all OmarJ nodes Fixed sending signals over the Grid Fixes race condition in JiniTest, causing some tests to fail sometimes. Additional Features: Added a NodeController gui that allows you to control remote nodes by sending node control signals to start/stop/pause/resume a scenario. Added node control signals for setting and getting the real time factor, so the real time factor can be changed remotely Finished filter implementation for the socket comm protocol Added new node control message: get current scenario Enable OmarJ nodes to modify the details of a lijos Lisp connection (to OmarL) GridHelper supports CoABS Grid version 3.3.X now API changes: changed name of silk (the scheme Java implementation) to jscheme added abort method for Futures, allowing them to be killed by another thread S.setCurrentScenario does a call to stopScenario to stop any existing scenario Scenario.stopScenario always calls the scenarioStop method Scenario.startScenario will block until the clock is no longer UNINITIALIZED The Log object now sets stdout and stderr to the same stream to remove any interleaving problems when both are printed to the same console/file. Node.java refactored. Node is now an abstract base class instead of an interface. Node control signal handlers have been moved to Node Changed FIPASignal to use Date for the replyBy field Changed FIPASignal parsing to use the simple AgentID readFromString assorted minor method changed enumerated below --------------------------------------------------------- Long Version --------------------------------------------------------- scorej package -------------- ID: All members of the ID class hierarchy now implement java.io.Serializable AgentID: readFromString enahnced to be able to parse FIPASignal agentIDs Invocation: toString method added to Invocation JoinFuture: name change of silk to jscheme fixed a ClassCastException bug removed print of silk.BacktraceException added public abort method allowing a thread external to the future to kill the future. Useful for re-initializing a simulation that has infinite loop threads. Log.java: Fixed bug causing output to the logfile to be printed multiple times Fixed bug caused by calling setLogFile multiple times Set stdout and stderr to the same stream so exception stack traces are not interleaved with regular program output. Added new Log level of LOWEST Made it so that all TIME_UPDATE message processing (except for signal matching) is of level LOWEST OmarClock: Throw a ScoreException when interruptClock is interrupted. Made setRealTime do an interruptClock because if we're sleeping, the time factor may be different, and we may want to sleep for a different amount of time. Removed the synchronization in getTime, since all it does is return a double. Fixed setting the real time factor of the clock while the simulation is running. Previously, if you modified the factor during a run of a clock running in real time mode, the sleeps would be incorrect because the zero time wasn't changed to reflect the new real-time factor. Added test in SemaphoreTest that sets the real time factor during a run. divided getStateString in OmarClock into 2 methods, getThreadStateString and getClockStateString. They cant be the same method, since thread states and clock states are different enumerations that use the same numbers. RaceFuture: Removed RunnableMethod inner class because it's not actually used ever. The RunnableMethod class that is used is the one defined in JoinFuture.java S: Throw a ScoreException when sendSignalLocal catches a InterruptedException so races can clean up properly Allow runClock to be called when the clock is in the KILLED state. changed setCurrentScenario so that the catch for the inner try catches only NoSuchMethodException, instead of Exception, so that it will try the other constructor only when the problem is that there isn't a constructor that takes a String, instead of any problem at all name change of silk to Jscheme changed setCurrentScenario to call stopScenario on old current scenario, if there is one, before setting the new current scenario tried to improve upon the Javadoc for spawn, including lessons learned; changed setCurrentScenario(Scenario) to add the scenario to the list of scenarios if not already there changed startCurrentScenario (OmarClock, boolean) to actually use the supplied arguments in the call to Scenario.initializeScenario throw the exceptions in JiniHelper unicastRegister and multicastRegister methods so that the user can be notified when registration failed. re-arranged sendSignalGlobal so that call to sendSignalLocal happens right before returning from the method. This fixes the bug with sendSignalLocal's stamping the signal as immutable (if it matches in the local node) and then CommProtocol's trying to set the sender on the immutable signal while sending the signal out of the node. SaveOutput: Redirected System.out and System.err to the same printstream. This should fix all interleaving problems, with the cost of being unable to separate out and err. Fixed output going to the logfile Removed synchronization blocks causing deadlock Attempt at synchronizing between stdout and stderr using a static synchronization variable Made Stdout and Stderr always print to the console, even if Console output is OFF. Now turning console output off will only turn off log message printing. Scenario: Added a scenarioResumed method that can be overridden by subclasses that gets called when the scenario is resumed after a pause. changed stopScenario to always call scenarioStop, even if the scenario wasn't officially started. This allows scenario authors to use scenarioStop to clean up before the scenario is re-initialized or before a new scenario becomes the current one after this one has been initialized but not run. changed startScenario so that scenarioProcedure is never called while the clock is uninitialized and also does not return while the clock is uninitialized ScoreJAgent: added an unregister and made register and unregister public Added hack to register method to avoid calling registerAgent when the protocol is the SignalServer. SignalServer.registerAgent throws an UnsupportedOperationException everytime it is called, which prevents a ScorejAgent from being instantiated when the node is using a SignalServer protocol. SignalProcessor: Fixed 2 race-condition timing bugs. One in waitForSignal in SignalProcessor.java, and the other in the analogous method in SignalWaitQueue.java. These bugs were caused by having the thread state in the clock set to waiting before the signal wait was actually registered. Checked in 2 tests that try to catch this bug Moved the Blinker process to STestSuite and made static methods for starting it. Made all tests start the Blinker (process that wastes cpu cycles), and turn all Logging on. added explanatory message to the ScoreException thrown when an InterruptedException occurs in waitForSignal Made SignalWaitQueues work with the SimulationClock. SignalWaitQueues were never meant to be used with the SimulationClock (they aren't necessary unless you use the NonSim Clock). However, they were being used in many places and there's no reason not to use them if you really want to. Previously, when you did a waitForSignal on a queue using the SimulationClock, you were never guaranteed what the clock time would be when that waitForSignal finished. This lead to some intermittent strangeness. Now SignalWaitQueue threads are woken up just like for standard SignalWaits. A test in SignalWaitQueueTest has been added to catch this intermittent bug. In registerSignal, don't interrupt clock if clock is null, but register the signal anyways. scorej.external package: ------------------------------------------------ CommProtocol: Tweaked comments, added changeFilters(Vector) as an abstract method to be consistent. throw the exceptions in JiniHelper unicastRegister and multicastRegister methods so that the user can be notified when registration failed added support for turning on/off agent and filter registration Filter: Added encodeFilterInVector function, which is the reverse operation of constructFilterFromVector Changed some of the log levels on Filter processing MessagingConstants: Added set real time factor and get real time factor node control messages Added Get Current Scenario node control message Node: Added set real time factor and get real time factor node control messages Fixed javadoc comments Removed a system.err.println that wasnt accurate Finished filter implementation for the socket protocol. Made the socket protocol consistent with other protocols (jini) by adding a LocalNode object. This represents the the local node, and holds data such as filters. (and would hold white-pages data if that ever gets implemented). Socket nodes can refer to eachother by node names (which are known to the programmer) or by host:ports changed handleNodeControlSignal to ignore NODE_CONTROL_RESPONSE instead of sending a "Warning: Node-Control command not implemented" message fixed JavaDoc comment for Initialize Scenario node control message by adding the fact that it expects the name of the scenario as the first signalArg added Get Current Scenario node control message Refactored Node.java. Node is now an abstract base class instead of an interface. Node Control handlers have been moved to Node (they were in multiple places before). Node control Signal processing has been moved to Node, because once a CommProtocol has processed its input into a Signal, the node control processing is the same. scorej.external.socket ------------------------------------------------------ CapConnection: Fixed javadoc comments commented out printlns Made Signal with one single argument that is a DistOmarEvent get sent over as DistOmarEvents instead of as a Signal. This is for OmarL compatability. Anyone not communicating with OmarL wont be using DistOmarEvents Finished filter implementation for the socket protocol added method getSocket Refactored lijos-datastream.lisp Minor updates here, to enable ScoreJ nodes to modify the details of a lijos Lisp connection. if protocol is TYPE_VALUE_GUI, convert outgoing signal to DistOmarEvent_Gui_Server before writing to objstream FIPAScoreJParser: Use AgentID's parsing mechanism name change of silk to jscheme added Get Current Scenario node control message LijosScoreJParser: Enable ScoreJ nodes to modify the details of a lijos Lisp connection. All gui control events are for this node if not specified LocalNode: new class that represents the local node for the socket comm protocol, and holds data such as filters. (and would hold white-pages data if that ever gets implemented). Socket nodes can refer to eachother by node names (which are known to the programmer) or by host:ports SignalServer: added checks to test whether agent and filter registration is enabled scorej.external.jini package: ------------------------------------------------- JiniHelper: fixed possible NullPointerException in discovered tweaked comments made package protected members private fixed bug causing possible NullPointerException in updateEntry throw the exceptions in JiniHelper unicastRegister and multicastRegister methods so that the user can be notified when registration failed added checks to test whether agent and filter registration is enabled scorej.external.grid package: -------------------------------------------------- GridHelper: Added getDirectory method Auto converting of incoming Grid messages with "FIPA" as the ACL into scorej FIPASignals Note: This will not affect Grid registration/log messages, since those have the Acl set to "FIPA-ACL" Fixed findOmarNodes, all ScoreJ Grid nodes should be found now Fix sending signals over the grid updateEntry is public since agents may want to call it D/O Icon is the default iconURL in CoABSAgentDescription Supports Grid version 3.3.1 Added the new changeFilters function recently defined as abstract in CommProtocol Supports Grid version 3.3.0 added checks to test whether agent and filter registration is enabled scorej.tests package: -------------------------------------------------- STestSuite: Moved the Blinker process to STestSuite and made static methods for starting it Made all tests start the Blinker (process that wastes cpu cycles), and turn all Logging on CapTest: Made sure to stop the blinker process during tearDown Added a filter encoding test Made the port numbers different so they wont conflict with the standard default OmarJ/L ports, if any instance of those are left running JiniTest: Send SHUTDOWN signal in the node-control test to ensure the remote node actually shuts down properly Jini tests were commented out by accident (except for the last one) Added NodeControl test to JiniTest Slight modification to the Node api required a change in SerilizationTest and StringifyTest (change to the signature of getIncomingSignal used by the Caps) Fixed race condition in JiniTest between registering and agent with Jini and having that registration propogated to all JiniNodes, and that agent sending a message RaceTest: Removed improper assert in testOneInfinteRace. It now succeeds properly Added a new test that caught a bug in the new silk.jar ResourcesTest: Fixed javadoc comments SchemeTest: Name change of silk to jscheme SignalWaitQueueTest: Added a test to catch the intermittent bug that happened when SignalWaitQueues were used with the SimulationClock scorej.gui.networkviewer package: -------------------------------------------------- NetworkViewer: made docBase a cmd option (-docBase) instead of a system property. Fixed ClassCastException while extracting time value from TIME_UPDATE signal. Time value is now a Double instead of a String. Exceptions cam be thrown in JiniHelper unicastRegister and multicastRegister methods now, so catch them some method name changes ControlPanel: some method name changes scorej.acl package: ------------------------------------------------- AclHelper: added isEmpty method name change of silk to jscheme added getLength and isList methods scorej.acl.fipa package: ------------------------------------------------- FIPASignal: Use AgentID's parsing for agent identifiers Change replyBy to be a Date name change of silk to jscheme Added signal evaluator for FIPA signals FIPASignalEvaluator: New class implementing a SignalEvaluator that recognizes FIPA signals scorej.conflicts package: ------------------------------------------------- ConflictsAgent: added constructors to match ScoreJAgent scorej.events package: ------------------------------------------------- EventViewer: Catch exceptions in JinHelper's unicast/multicastRegister when the registratons fail ForkEvent: changed getTopLevelMethod in SpawnEvent and ForkEvent to getSpawnMethod and getForkMethod, respectively added some JavaDoc comments SpawnEvent: changed getTopLevelMethod in SpawnEvent and ForkEvent to getSpawnMethod and getForkMethod, respectively added some JavaDoc comments