Hello,

I´ve got two problems with ptolemy 0.7 under suse linux5.1.

1. I want to stop my simulation when a certain condition occur. I found
in the SDFReadFile star the following method which maybe does this:
        SimControl::requestHalt()
Does this method wait until the current simulation run is finished and
then stop? Can I display the simulation results so far or not?

2. The following star is simplified version of a star I wrote. Here I
want to store the maximum value of all input samples  and then output
this value.

defstar {
 name { test }
 domain { SDF }
 input {
  name { input }
  type { float }
 }
 output {
  name { output }
  type { float }
 }
 protected {
  float *best;
 }
 constructor {
  best = 0;
 }
 destructor {
  LOG_DEL; delete best;
 }
 setup {
  LOG_DEL; delete best;
  LOG_NEW; best = new float[sizeof(float)];

  *best = 0;
 }
 go {
  if (input%0 > *best)
   *best = input%0;
 }
 wrapup {
  output%0 << *best;
 }
}

If the simulation runs 16 times, the star however outputs 16 times the
value '0'.

How can I modify my star so that it outputs only one value and only the
maximum one?


----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to