* @exception Exception If something goes wrong. This is a broad
* exception to allow derived classes wide lattitude as to which
* exception to throw.
*/
protected NamedObj _createModel(Workspace workspace) throws Exception {
TypedCompositeActor toplevel = new TypedCompositeActor(workspace);
_toplevel = toplevel;
toplevel.setName("BusContention");
new CSPDirector(toplevel, "CSPDirector");
// Instantiate Actors
_contentionActor = new Controller(toplevel, "controller");
_alarmActor = new ContentionAlarm(toplevel, "alarm");
_memoryActor = new Memory(toplevel, "memory");
_processActor1 = new Processor(toplevel, "proc1", 1);
_processActor2 = new Processor(toplevel, "proc2", 2);
_processActor3 = new Processor(toplevel, "proc3", 3);
// Set up connections
toplevel.connect(_contentionActor.requestInput,
_processActor1.requestOutput);
toplevel.connect(_contentionActor.requestInput,
_processActor2.requestOutput);
toplevel.connect(_contentionActor.requestInput,
_processActor3.requestOutput);
toplevel.connect(_contentionActor.contendOutput, _alarmActor.input);
toplevel.connect(_contentionActor.contendInput, _alarmActor.output);
toplevel.connect(_contentionActor.requestOutput,
_processActor1.requestInput);
toplevel.connect(_contentionActor.requestOutput,
_processActor2.requestInput);
toplevel.connect(_contentionActor.requestOutput,
_processActor3.requestInput);
toplevel.connect(_memoryActor.output, _processActor1.memoryInput);
toplevel.connect(_memoryActor.output, _processActor2.memoryInput);
toplevel.connect(_memoryActor.output, _processActor3.memoryInput);
toplevel.connect(_memoryActor.input, _processActor1.memoryOutput);
toplevel.connect(_memoryActor.input, _processActor2.memoryOutput);
toplevel.connect(_memoryActor.input, _processActor3.memoryOutput);
return toplevel;
}