No problem. I will try that and let you know if I succeed. On 7/19/05, Edward A. Lee <[EMAIL PROTECTED]> wrote: > > Apologies for the delay in responding... > > In the current version of Ptolemy II (accessible by CVS or by the > 5.0-beta release or the imminent 5.0 release), there is a demo > in the tour called IncreasingRatePoisson that shows how to do this. > It gives the "exponential" version. To get the "uniform" version, > just change the action expression on the transition from the init > to the wait state. That expression currently reads: > > wait.threshold = -log(1-random()) > > If you change it to, for example: > > wait.threshold = random() > > then the model will remain in the wait state for a random amount > of time that is uniformly distributed between 0 and 1. > > Edward Lee > > At 11:32 AM 6/30/2005 -0400, V P wrote: > >Folks: > >I would like to model a CT stochastic process as follows: > > > >Two states - ON, and OFF with output values of 1 and 0 respectively > >process randomly transitions from ON to OFF state. > >duration of ON state should be exponentially distributed > >duration of OFF state should be uniformly distributed > > > >I am hoping that I can achieve this by modifying the three state > >Continuous Clock example by Haiyang Zheng. Does this make sense? Are > >there better ways to achieve what I want? > > > >As a test, I deleted state3 in that example and changed the state2 --> > >state1 transition guardExpression from " time == timeInterval" to > >"time == timeInterval + random()" to make it random. I got the > >following from the CT Director: > > > >ptolemy.kernel.util.IllegalActionException: The refined step size is > >less than the minimum time resolution, at time 3.7096332590000003 > > in .vj_ContinuousClock.CT Director > > at > > ptolemy.domains.ct.kernel.CTMultiSolverDirector._refinedStepWRTOutput(CTMultiSolverDirector.java:1257) > > at > > ptolemy.domains.ct.kernel.CTMultiSolverDirector._resolveInitialStates(CTMultiSolverDirector.java:1567) > > at > > ptolemy.domains.ct.kernel.CTMultiSolverDirector._continuousPhaseExecution(CTMultiSolverDirector.java:900) > > at > > ptolemy.domains.ct.kernel.CTMultiSolverDirector.fire(CTMultiSolverDirector.java:367) > > at > > ptolemy.domains.ct.kernel.CTMixedSignalDirector.fire(CTMixedSignalDirector.java:189) > > at ptolemy.actor.CompositeActor.fire(CompositeActor.java:329) > > at ptolemy.actor.Manager.iterate(Manager.java:601) > > at ptolemy.actor.Manager.execute(Manager.java:319) > > at ptolemy.actor.Manager.run(Manager.java:951) > > at ptolemy.actor.Manager$2.run(Manager.java:1003) > > > >Why am I getting this error? How can I avoid it? > >Any help would be greatly appreciated. > > > >Vijaya Poudyal > > > > > >---------------------------------------------------------------------------- > >Posted to the ptolemy-hackers mailing list. Please send administrative > >mail for this list to: [EMAIL PROTECTED] > > ------------ > Edward A. Lee > Professor, Chair of the EE Division, Associate Chair of EECS > 231 Cory Hall, UC Berkeley, Berkeley, CA 94720 > phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845 > [EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal > >
---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: [EMAIL PROTECTED]