context.debugObject.addEntity();
    public void executeGenerateAction( GenerateAction a, Context c ) throws LemRuntimeException {        LinkedList p = a.getParameters();        LinkedList passedValues = null;        int eventid = 0;                if ( p != null ) {            passedValues = new LinkedList();                        /* Evaluate parameters - pass by value obviously */            Iterator i = p.iterator();            while ( i.hasNext() ) {                Expression e = ( Expression ) i.next();                Variable result = evaluateExpression( e, c );                passedValues.add( result );            }        }                VariableReference vr = a.getTarget();        Variable targetRef = getVariable( vr, c );        if ( !( targetRef instanceof ObjectReferenceVariable ) ) {            throw new LemRuntimeException( "Type mismatch: expected objref, got " + targetRef.getType().getName() );        }                runtime.Object target = ( runtime.Object ) ( ( ObjectReferenceVariable ) targetRef ).getValue();                // if we are not in Scenario        int id1=0;        if(currentObject != null)            id1 = currentObject.getObjectId().intValue();                int id2 = target.getObjectId().intValue();                        // Find the event to be fired on the given object        Event e = target.findEvent( a.getEventName(), a.getParameters() );        String type = e.getName();                        if ( e == null ) {            // TODO: Don't use single-arg constructor for LemRuntimeException            throw new LemRuntimeException( "Could not find named event" );        }        // Create the new signal        Expression delayExpression = a.getDelayTime();        if ( delayExpression != null ) {            Variable v = evaluateExpression( delayExpression, c );            if ( !( v instanceof NumericVariable ) ) {                throw new LemRuntimeException( "Type mismatch: expected numeric, got " + v.getType().getName() );            }            BigDecimal delay = ( BigDecimal ) v.getValue();            DelayedSignal ds = new DelayedSignal( e, target, delay );            if ( passedValues != null )                ds.setParameters( passedValues );	    System.out.println(currentObject.getObjectId() + " generating delayed signal (" + delay + ") to " + target.getObjectId());            eventid = ds.getSignalId().intValue();                        new LemEventGenerationEvent(id1, id2, eventid, type, p, delay).notifyAll( c );                        if ( target == currentObject ) {                currentObject.addDelayedSignalSelf( ds );            } else {                currentObject.addDelayedSignal( ds );            }        } else {            Signal s = new Signal( e );            Integer signalId = s.getSignalId() ;            Integer targetObjectId = target.getObjectId() ;            if ( passedValues != null )                s.setParameters( passedValues );	    if (currentObject == null)		    System.out.print("[main]");	    else		    System.out.print(currentObject.getObjectId());	    System.out.println(" generating signal to " + target.getObjectId());            eventid = s.getSignalId().intValue();                        new LemEventGenerationEvent(id1, id2, eventid, type, p).notifyAll( c );             if ( target == currentObject ) {                target.addSignalSelf( s );            } else {                target.addSignal( s );            }                                }       }