The offending lines are these:
} catch (Exception e) {
e.printStackTrace();
throw new IllegalActionException(e.getMessage());
}
The issue is that in PN, the fire() method is invoked in an infinite
loop in its own
It might be best to re-throw the exception in case the method is expanded
on. That is:
} catch (Exception e) {
if (!(e instanceof TerminateProcessExeption)) {
e.printStackTrace();
throw new IllegalActionException(this, e, e.getMessage());
}
else
throw e;
}
Colin
Ah, right. Actually, if you don't rethrow the exception,
the thread won't terminate...
Edward
On 6/22/11 7:02 AM, Colin Enticott wrote:
It might be best to re-throw the exception in case the method is
expanded on. That is:
} catch (Exception e) {
if (!(e instanceof
Now it works!
I actually implemented it like this:
} catch (TerminateProcessException e) {
throw e;
} catch (Exception e) {
throw new IllegalActionException(this, e,
e.getMessage());
}
Indeed,
Hi Vincenzo,
Without sample code, it is hard to say for sure, but I believe
you need to check the for the token in fire()
if (input.hasToken(0)) {
}
Page 194 of the Designing Actors chapter in Volume 1 of the Design Doc at
http://ptolemy.eecs.berkeley.edu/ptolemyII/designdoc.htm
says:
* A
Hi Christopher,
First of all, thanks for your answer.
On 21/06/2011 16:31, Christopher Brooks wrote:
Without sample code, it is hard to say for sure, but I believe
you need to check the for the token in fire()
if (input.hasToken(0)) {
}
It is what I'm doing: if you look at the logs I sent,
Something's fishy here.
Such a model should work fine in PN.
Note that hasToken() _alaways_ returns true in PN.
The get() method blocks when there is no input.
Looks like something is terminating the threads
using a TerminateProcessException. How is your model
supposed to be stopped?
Edward
Hi Vincenzo,
Do you have a small test actor and sample model?
_Christopher
On 6/21/11 8:05 AM, Vincenzo Forchi wrote:
Hi Edward,
On 21/06/2011 16:53, Edward A. Lee wrote:
Something's fishy here.
Such a model should work fine in PN.
Note that hasToken() _alaways_ returns true in PN.
That's
PN wraps every actor in an infinite loop that executes in it's own thread. I
think what is happening is that the director is detecting that no tokens are
available and is killing blocked threads to stop the execution. This would be
normal, I think. How else would you stop a blocked thread? The
9 matches
Mail list logo