<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 8/4/12 10:53 AM, Edward A. Lee
      wrote:<br>
    </div>
    <blockquote cite="mid:501D6189.5010106@eecs.berkeley.edu"
      type="cite">Jennifer suggests changing the default iterations
      count of the SDF
      <br>
      director from 0 to 1. I think this is a good idea, but we should
      <br>
      then change all the demos that use the default.  Any idea how
      <br>
      to find them?  These would be demos with an SDFDirector that
      <br>
      do _not_ set the iterations parameter.
      <br>
    </blockquote>
    <br>
    Edward, <br>
    I hacked up an awk script that attempts to insert the iterations
    parameter<br>
    if it is not set in SDFDirector or any of the derived classes.<br>
    <br>
    The body of the script looks like:<br>
    <blockquote type="cite">awk
      '{                                                                                                                                                                        
       <br>
                       if ($0 ~ /SDFDirector"/ || $0 ~/DTDirector"/ ||
      $0 ~ /HDFDirector"/ || $0 ~ /PthalesDirector"/)
      {                                                                    
       <br>
                          
      sawSDFDirector=1                                                                                                                                                 
       <br>
                           split($0, indent,
      "<")                                                                                                                                           
       <br>
                           closer= indent[1]
      "</property>"                                                                                                                                  
       <br>
                      
      }                                                                                                                                                                    
       <br>
                       if (sawSDFDirector == 1)
      {                                                                                                                                           
       <br>
                           if ($0 ~ /<property name="iterations"/)
      {                                                                                                                        
       <br>
                              
      sawIterations=1                                                                                                                                              
       <br>
                          
      }                                                                                                                                                                
       <br>
                           if ($0 == closer)
      {                                                                                                                                              
       <br>
                              if (sawIterations == 0)
      {                                                                                                                                     
       <br>
                                 print indent[1] "    <property
      name=\"iterations\" class=\"ptolemy.data.expr.Parameter\"
      value=\"0\">"                                                     
       <br>
                                 print indent[1] "   
      </property>"                                                                                                                          
       <br>
                             
      }                                                                                                                                                             
       <br>
                             
      sawSDFDirector=0                                                                                                                                              
       <br>
                             
      sawIterations=0                                                                                                                                               
       <br>
                          
      }                                                                                                                                                                
       <br>
                      
      }                                                                                                                                                                    
       <br>
                       print
      $0                                                                                                                                                             
       <br>
                   }' $file </blockquote>
    <br>
    Basically, it looks for SDFDirector or its subclasses and the
    inserts the iterations parameter<br>
    if it is not already set.<br>
    <br>
    I ran the tests and while there are a number of failures, it is not
    looking<br>
    so bad.<br>
    <br>
    Shall I check in the changed .xml files?<br>
    <br>
    Note that there is an open Kepler bug:<br>
    "
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <span id="summary_alias_container"><span
        id="short_desc_nonedit_display">SDF director iterations
        parameter default of 0 is unfriendly"</span></span><br>
    <a class="moz-txt-link-freetext" href="http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5546">http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5546</a><br>
    <br>
    This change will requires updating documentation in both Ptolemy II
    and Kepler.<br>
    <br>
    _Christopher<br>
    <pre class="moz-signature" cols="72">-- 
Christopher Brooks, PMP                       University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841                                (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670 </pre>
  </body>
</html>