Class Rerun

  • All Implemented Interfaces:
    ExecutionListener, ChangeListener

    public class Rerun
    extends MoMLSimpleApplication
    Run a MoML model over and over again. This class reads in a MoML file and executes it over and over again. The time and memory usage stats are printed on stdout. For example to run a model 100 times:
     cd $PTII/ptolemy/actor/gui/test
     java -classpath $PTII ptolemy.actor.gui.test.Rerun ../../lib/test/auto/Sinewave.xml
     
    To run the model 10 times:
     java -classpath $PTII ptolemy.actor.gui.test.Rerun 10 ../../lib/test/auto/Sinewave.xml
     
    To create a ptplot file of the times and memory:
     awk '{  t[NR] = $1;
     m[NR] = substr($4, 0, length($4) - 1);
     f[NR] = substr($6, 0, length($6) - 1);
     }
     END {  print "dataset: time (ms)";
     for (i=1;i<=NR;i++) {print i, t[i]};
     print "dataset: memory (K)";
     for (i=1;i<=NR;i++) {print i, m[i]};
     print "dataset: free (K)";
     for (i=1;i>=NR;i++) {print i, f[i]};
     }' /tmp/t > /tmp/t.plt
    
     
    Since:
    Ptolemy II 4.1
    Version:
    $Id$
    Author:
    Christopher Hylands Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (eal)
    • Constructor Detail

      • Rerun

        public Rerun​(java.lang.String xmlFileName)
              throws java.lang.Throwable
        Parse the xml file and run it.
        Parameters:
        xmlFileName - A string that refers to an MoML file that contains a Ptolemy II model. The string should be a relative pathname.
        Throws:
        java.lang.Throwable - If there was a problem parsing or running the model.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Create an instance of a single model and run it.
        Parameters:
        args - The command-line arguments naming the .xml file to run