[kepler-users] DDF Problem
Edward A. Lee
eal at eecs.berkeley.edu
Wed Nov 21 09:04:59 PST 2007
The documentation for the DDF director says:
Note that any SDF model can be run with a DDF Director. However, the notion of iteration is different. One could try to imitate the SDF iteration in the DDF domain by controlling the number of firings in one iteration for some actors, such as requiring a plotter to plot a fixed number of points in each iteration.
It also says:
A user can treat several such basic iterations as a single iteration by adding a parameter with name requiredFiringsPerIteration to an actor (which is often a sink actor or an actor directly connected to output port of the composite actor) and specifying the number of times this actor must be fired in a single iteration.
So, if I add a parameter named requiredFiringsPerIteration to your
AddSubtract actor and give it the value 1, then I get what I think
you want.
Edward
At 08:57 AM 11/20/2007, Frank Steinmann wrote:
>Hi all,
>
>I'm trying to use a DDF composite actor inside an SDF workflow (see attached file). My simple question: Why do I need 2 iterations of the SDF Director to get an output value?
>
>Regards,
>Frank
>
>--
>Dipl.-Inf. Frank Steinmann
>Knowledge Management Department
>DFKI GmbH
>
>Tel.: +49 (0)631 20575 - 114
>Sekr.: +49 (0)631 20575 - 101
>Fax: +49 (0)631 20575 - 103
>E-Mail: Frank.Steinmann at dfki.de
>-----------------------------------------------------------
>Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
>Trippstadter StraÃe 122, D-67663 Kaiserslautern, Germany
>
>Geschäftsführung:
>Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
>Dr. Walter Olthoff
>
>Vorsitzender des Aufsichtsrats:
>Prof. Dr. h.c. Hans A. Aukes
>
>Amtsgericht Kaiserslautern, HRB 2313
>-----------------------------------------------------------
>
>
><?xml version="1.0" standalone="no"?>
><!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
> "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
><entity name="ddf_test" class="ptolemy.actor.TypedCompositeActor">
> <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="6.1.devel">
> </property>
> <property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
> <property name="iterations" class="ptolemy.data.expr.Parameter" value="2">
> </property>
> <property name="vectorizationFactor" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> <property name="allowDisconnectedGraphs" class="ptolemy.data.expr.Parameter" value="false">
> </property>
> <property name="allowRateChanges" class="ptolemy.data.expr.Parameter" value="false">
> </property>
> <property name="constrainBufferSizes" class="ptolemy.data.expr.Parameter" value="true">
> </property>
> <property name="period" class="ptolemy.data.expr.Parameter" value="0.0">
> </property>
> <property name="synchronizeToRealTime" class="ptolemy.data.expr.Parameter" value="false">
> </property>
> <property name="timeResolution" class="ptolemy.moml.SharedParameter" value="1E-10">
> </property>
> <property name="Scheduler" class="ptolemy.domains.sdf.kernel.SDFScheduler">
> <property name="constrainBufferSizes" class="ptolemy.data.expr.Parameter" value="constrainBufferSizes">
> </property>
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Steve Neuendorffer</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
><p>The SDF Director is often used to oversee fairly simple, sequential workflows in which the director can determine the order of actor invocation from the workflow. Types of workflows that would run well under an SDF Director include processing and reformatting tabular data, converting one data type to another, and reading and plotting a series of data points. A workflow in which an image is read, processed (rotated, scaled, clipped, filtered, etc.), and then displayed, is also an example of a sequential workflow that requires a director simply to ensure that each actor fires in the proper order (i.e., that each actor executes only after it receives its required inputs).</p>
>
><p>The SDF Director is very efficient and will not tax system resources with overhead. However, this efficiency requires that certain conditions be met, namely that the data consumption and production rate of each actor in an SDF workflow be constant and declared. If an actor reads one piece of data and calculates and outputs a single result, it must always read and output a single token of data. This data rate cannot change during workflow execution and, in general, workflows that require dynamic scheduling and/or flow control cannot use this director. Additionally, the SDF Director has no understanding of passing time (at least by default), and actors that depend on a notion of time may not work as expected. For example, a TimedPlotter actor will plot all values at time zero when used in SDF. </p>
>
><p>By default, the SDF Director requires that all actors in its workflow be connected. Otherwise, the director cannot account for concurrency between disconnected workflow parts. Usually, a PN Director should be used for workflows that contain disconnected actors; however, the SDF Director's allowDisconnectedGraphs parameter may also be set to true. The SDF Director will then schedule each disconnected "island" independently. The director cannot infer the sequential relationship between disconnected actors (i.e., nothing forces the director to finish executing all actors on one island before firing actors on another). However, the order of execution within each island should be correct. Usually, disconnected graphs in an SDF model indicate an error.</p>
>
><p>Because SDF Directors schedule actors to fire only after they receive their inputs, workflows that require loops (feeding an actor's output back into its input port for further processing) can cause "deadlock" errors. The deadlock errors occur because the actor depends on its own output value as an initial input. To fix this problem, use a SampleDelay actor to generate and inject an initial input value into the workflow.</p>
>
><p>The SDF Director determines the order in which actors execute and how many times each actor needs to be fired to complete a single iteration of the workflow. This schedule is calculated BEFORE the director begins to iterate the workflow. Because the SDF Director calculates a schedule in advance, it is quite efficient. However, SDF workflows must be static. In other words, the same number of tokens must be consumed/produced at every iteration of the workflow. Workflows that require dynamic control structures, such as a BooleanSwitch actor that sends output on one of two ports depending on the value of a 'control', cannot be used with an SDF Director because the number of tokens on each output can change for each execution.</p>
>
><p>Unless otherwise specified, the SDF Director assumes that each actor consumes and produces exactly one token per channel on each firing. Actors that do not follow the one-token-per-channel firing convention (e.g., Repeat or Ramp) must declare the number of tokens they produce or consume via the appropriate parameters. </p>
>
><p>The number of times a workflow is iterated is controlled by the director's iterations parameter. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. A value of 1, meaning that the director will run the workflow once, is often the best setting when building an SDF workflow. </p>
>
><p>The amount of data processed by an SDF workflow is a function of both the number of times the workflow iterates and the value of the director's vectorizationFactor parameter. The vectorizationFactor is used to increase the efficiency of a workflow by increasing the number of times actors fire each time the workflow iterates. If the parameter is set to a positive integer (other than 1), the director will fire each actor the specified number of times more than normal. The default is 1, indicating that no vectorization should be performed. Keep in mind that changing the vectorizationFactor parameter changes the meaning of a nested SDF workflow and may cause deadlock in a workflow that uses it. </p>
>
><p>The SDF Director has several advanced parameters that are generally only relevant when an SDF workflow contains composite components. In most cases the period, timeResolution, synchronizeToRealTime, allowRateChanges, timeResolution, and constrainBufferSizes parameters can be left at their default values.</p>
>
><p>For more information about the SDF Director, see the Ptolemy documentation (http://ptolemy.eecs.berkeley.edu/papers/05/ptIIdesign3-domains/ptIIdesign3-domains.pdf).</p>
>
></configure></property>
><property name="prop:allowDisconnectedGraphs" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether to allow disconnected actors in the workflow (by default, all actors are required to be connected). If disconnected actors are permitted, the SDF Director will schedule each disconnected 'island' independently. Nothing "forces" the director to finish executing all actors on one island before firing actors on another. However, the order of execution within each island should be correct. Usually, disconnected graphs in an SDF workflow indicate an error.</configure></property>
><property name="prop:allowRateChanges" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether dynamic rate changes are permitted or not. By default, rate changes are not permitted, and the director will perform a check to disallow such workflows. If the parameter is selected, then workflows that require rate parameters to be modified during execution are valid, and the SDF Director will dynamically compute a new schedule at runtime. This is an advanced parameter that can usually be left at its default value.</configure></property>
><property name="prop:constrainBufferSizes" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether buffer sizes are fixed. By default, buffers are fixed, and attempts to write to the buffer that cause the buffer to exceed its scheduled size result in an error. This is an advanced parameter that can usually be left at its default value.</configure></property>
><property name="prop:timeResolution" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The time precision used by this director. All time values are rounded to the nearest multiple of this number. The value is a double that defaults to "1E-10" (which is 10-10). This is an advanced parameter that can usually be left at its default value.</configure></property>
><property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. A value of 1, meaning that the director will run the workflow once, is often the best setting when building an SDF workflow. </configure></property>
><property name="prop:vectorizationFactor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vectorizationFactor is used to increase the efficiency of a workflow by increasing the number of times actors fire each time the workflow iterates. If the parameter is set to a positive integer (other than 1), the director will fire each actor the specified number of times more than normal. The default is 1, indicating that no vectorization should be performed. Keep in mind that changing the vectorizationFactor parameter changes the meaning of a nested SDF workflow and may cause deadlock in a workflow that uses it. </configure></property>
><property name="prop:synchronizeToRealTime" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether the execution should synchronize to real time or not. By default, the director does not synchronize to real time. If synchronize is selected, the director will only process the workflow when elapsed real time matches the product of the period parameter and the iteration count. Note: if the period parameter has a value of 0.0 (the default), then selecting this parameter has no effect. This is an advanced parameter that can usually be left at its default value.</configure></property>
><property name="prop:period" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The time period of each iteration. The value is a double that defaults to 0.0, which means that the director does not increment workflow time. If the value greater than 0.0, the actor will increment workflow time each time it fires. This is an advanced parameter that can usually be left at its default value. </configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:director:1:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.domains.sdf.kernel.SDFDirector">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:directorclass:1:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Director">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Director">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{125, 120}">
> </property>
> </property>
> <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={154, 216, 875, 794}, maximized=false}">
> </property>
> <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 661]">
> </property>
> <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
> </property>
> <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{300.0, 330.5}">
> </property>
> <entity name="Constant" class="ptolemy.actor.lib.Const">
> <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
> </property>
> <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
> </property>
> <property name="value" class="ptolemy.data.expr.Parameter" value="1">
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Constant actor outputs a constant, which is specified by the value parameter. By default, the actor outputs the integer 1.</p>
>
><p>The actor can be used to output other types of values, e.g., a string (such as "Hello") or a double (such as 1.2). The actor'
>s output type matches the type of the specified value.</p>
>
><p>NOTE: If using a PN Director, the 'firingCountLimit' parameter is often set to a finite integer (e.g. '1') so that the workflow will terminate. </p>
></configure></property>
><property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the specified constant. By default, the output is 1.</configure></property>
><property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.</configure></property>
><property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
><property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the Constant actor. By default, the value is the integer token 1. The value can be set to another type, e.g., a string (such as "Hello") or a double (such as 1.2). The output type matches the type of the value specified here.</configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:1:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.Const">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:877:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ConstantActor">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
> </property>
> <property name="kar" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:kar:57:1">
> </property>
> <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
> <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
> </property>
> <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="40">
> </property>
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{180, 265}">
> </property>
> </entity>
> <entity name="CompositeActor" class="ptolemy.actor.TypedCompositeActor">
> <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="6.1.devel">
> </property>
> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:449:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
> </property>
> <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</p>
>
><p>To create a composite actor, drag and drop the Composite actor onto the Workflow canvas. Right-click the actor and select Open Actor from the drop-down menu. A new Kepler application window will open for designing the composite.</p></configure></property>
></property> <property name="_location" class="ptolemy.kernel.util.Location" value="{315, 265}">
> </property>
> <property name="DDF Director" class="ptolemy.domains.ddf.kernel.DDFDirector">
> <property name="timeResolution" class="ptolemy.moml.SharedParameter" value="1E-10">
> </property>
> <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
> </property>
> <property name="maximumReceiverCapacity" class="ptolemy.data.expr.Parameter" value="0">
> </property>
> <property name="runUntilDeadlockInOneIteration" class="ptolemy.data.expr.Parameter" value="false">
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Gang Zhou</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
> <p> The dynamic dataflow (DDF) domain is a superset of the synchronous
> dataflow(SDF) and Boolean dataflow(BDF) domains. In the SDF domain,
> an actor consumes and produces a fixed number of tokens per firing.
> This static information makes possible compile-time scheduling. In the
> DDF domain, there are few constraints on the production and consumption
> behavior of actors, and the schedulers make no attempt to construct a
> compile-time schedule. Instead, each actor has a set of firing rules
> (patterns) and can be fired if one of them is satisfied, i.e., one
> particular firing pattern forms a prefix of sequences of unconsumed
> tokens at input ports. The canonical actors in the DDF domain include
> Select and Switch, which consume or produce tokens on different channels
> based on the token received from the control port. (In practice, use
> DDFSelect and DDFBooleanSelect in the DDF-specific library instead of
> Select and BooleanSelect in the regular FlowControl library; however,
> Switch and BooleanSwitch in the regular FlowControl library can be
> used in DDF domain.)</p>
>
> <p> The dynamic scheduler implemented in this director fires all enabled
> and non-deferrable actors once in a basic iteration. A deferrable
> actor is one that will not help one of the downstream actors become
> enabled because that downstream actor either already has enough tokens on
> the channel connecting those two actors or is waiting for tokens on
> another channel. If no actor fires so far, which means there is no
> enabled and non-deferrable actor, then among all enabled and deferrable
> actors, this director fires those which have the smallest maximum number
> of tokens on their output channels which satisfy the demand of destination
> actors. If still no actor fires, then there is no enabled actor. A user
> can treat several such basic iterations as a single iteration by adding
> a parameter with name <i>requiredFiringsPerIteration</i> to an actor
> (which is often a sink actor or an actor directly connected to output port
> of the composite actor) and specifying the number of times this actor must
> be fired in a single iteration. If the value of the parameter
> <i>runUntilDeadlockInOneIteration</i> is a BooleanToken with value true,
> one single iteration consists of repeating the basic iteration until
> deadlock is reached (thus overriding the previous definition of one
> iteration), which is the status of the model where all active
> actors under the control of this director are unable to fire because
> their firing rules are not satisfied. However, they may be able to fire
> again during next iteration when tokens are transferred in from an outside
> domain. Note <i>runUntilDeadlockInOneIteration</i> can be set to true
> only when this director is not on the top level.</p>
>
> <p> The algorithm implementing one basic iteration goes like this:
> <pre>
> E = set of enabled actors
> D = set of deferrable enabled actors
> </pre>
> One basic(default) iteration consists of:
> <pre>
> if (E\D != empty set) {
> fire (E\D)
> } else if (D != empty set) {
> fire minimax(D)
> } else {
> declare deadlock
> }
> </pre>
> The function "minimax(D)" returns a subset of D with the smallest
> maximum number of tokens on their output channels which satisfy the
> demand of destination actors.</p>
>
> <p> Note that any SDF model can be run with a DDF Director. However, the
> notion of iteration is different. One could try to imitate the SDF
> iteration in the DDF domain by controlling the number of firings in one
> iteration for some actors, such as requiring a plotter to plot a fixed
> number of points in each iteration.</p>
>
> <p> In the DDF domain, the firing rule of any actor is specified by the token
> consumption rates of its input ports. A general DDF actor could change
> the consumption rates of its input ports after each firing of this actor.
> For multiports, an array token could be used to specify different rates
> for different channels connected to the same multiport. Note that in SDF,
> all channels connected to the same multiport have the same rate.</p>
>
> <p> Based on DDFSimpleSched in Ptolemy Classic, by Edward Lee.
> See E. A. Lee et al., "The Almagest," documentation for Ptolemy Classic,
> Vol. 1, Chapter 7, 1997.</p>
>
> </configure></property>
><property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
><property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
><property name="prop:runUntilDeadlockInOneIteration" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A parameter indicating whether one iteration consists of repeated basic iterations until deadlock. If this parameter is true, the model will be executed until deadlock in one iteration. The default value is a BooleanToken with the value false. It cannot be set to true if this director is at the top level.</configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:director:5:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.domains.ddf.kernel.DDFDirector">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:directorclass:5:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Director">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Director">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{150.0, 215.0}">
> </property>
> <property name="" class="ptolemy.vergil.basic.DocAttribute">
> <property name="description" class="ptolemy.data.expr.StringParameter" value="
<p> The dynamic dataflow (DDF) domain is a superset of the synchronous
dataflow(SDF) and Boolean dataflow(BDF) domains. In the SDF domain,
an actor consumes and produces a fixed number of tokens per firing.
This static information makes possible compile-time scheduling. In the
DDF domain, there are few constraints on the production and consumption
behavior of actors, and the schedulers make no attempt to construct a
compile-time schedule. Instead, each actor has a set of firing rules
(patterns) and can be fired if one of them is satisfied, i.e., one
particular firing pattern forms a prefix of sequences of unconsumed
tokens at input ports. The canonical actors in the DDF domain include
Select and Switch, which consume or produce tokens on different channels
based on the token received from the control port. (In practice, use
DDFSelect and DDFBooleanSelect in the DDF-specific library instead of
Select and BooleanSelect in the regular FlowControl library; however,
Switch and BooleanSwitch in the regular FlowControl library can be
used in DDF domain.)</p>
<p> The dynamic scheduler implemented in this director fires all enabled
and non-deferrable actors once in a basic iteration. A deferrable
actor is one that will not help one of the downstream actors become
enabled because that downstream actor either already has enough tokens on
the channel connecting those two actors or is waiting for tokens on
another channel. If no actor fires so far, which means there is no
enabled and non-deferrable actor, then among all enabled and deferrable
actors, this director fires those which have the smallest maximum number
of tokens on their output channels which satisfy the demand of destination
actors. If still no actor fires, then there is no enabled actor. A user
can treat several such basic iterations as a single iteration by adding
a parameter with name <i>requiredFiringsPerIteration</i> to an actor
(which is often a sink actor or an actor directly connected to output port
of the composite actor) and specifying the number of times this actor must
be fired in a single iteration. If the value of the parameter
<i>runUntilDeadlockInOneIteration</i> is a BooleanToken with value true,
one single iteration consists of repeating the basic iteration until
deadlock is reached (thus overriding the previous definition of one
iteration), which is the status of the model where all active
actors under the control of this director are unable to fire because
their firing rules are not satisfied. However, they may be able to fire
again during next iteration when tokens are transferred in from an outside
domain. Note <i>runUntilDeadlockInOneIteration</i> can be set to true
only when this director is not on the top level.</p>
<p> The algorithm implementing one basic iteration goes like this:
<pre>
E = set of enabled actors
D = set of deferrable enabled actors
</pre>
One basic(default) iteration consists of:
<pre>
if (E\D != empty set) {
fire (E\D)
} else if (D != empty set) {
fire minimax(D)
} else {
declare deadlock
}
</pre>
The function "minimax(D)" returns a subset of D with the smallest
maximum number of tokens on their output channels which satisfy the
demand of destination actors.</p>
<p> Note that any SDF model can be run with a DDF Director. However, the
notion of iteration is different. One could try to imitate the SDF
iteration in the DDF domain by controlling the number of firings in one
iteration for some actors, such as requiring a plotter to plot a fixed
number of points in each iteration.</p>
<p> In the DDF domain, the firing rule of any actor is specified by the token
consumption rates of its input ports. A general DDF actor could change
the consumption rates of its input ports after each firing of this actor.
For multiports, an array token could be used to specify different rates
for different channels connected to the same multiport. Note that in SDF,
all channels connected to the same multiport have the same rate.</p>
<p> Based on DDFSimpleSched in Ptolemy Classic, by Edward Lee.
See E. A. Lee et al., "The Almagest," documentation for Ptolemy Classic,
Vol. 1, Chapter 7, 1997.</p>
">
> </property>
> <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Gang Zhou">
> </property>
> <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
> </property>
> <property name="iterations (parameter)" class="ptolemy.data.expr.StringParameter" value="Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. ">
> </property>
> <property name="maximumReceiverCapacity (parameter)" class="ptolemy.data.expr.StringParameter" value="A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. ">
> </property>
> <property name="runUntilDeadlockInOneIteration (parameter)" class="ptolemy.data.expr.StringParameter" value="A parameter indicating whether one iteration consists of repeated basic iterations until deadlock. If this parameter is true, the model will be executed until deadlock in one iteration. The default value is a BooleanToken with the value false. It cannot be set to true if this director is at the top level.">
> </property>
> </property>
> </property>
> <port name="port" class="ptolemy.actor.TypedIOPort">
> <property name="input"/>
> <property name="_location" class="ptolemy.kernel.util.Location" value="[100.0, 330.0]">
> </property>
> </port>
> <port name="port2" class="ptolemy.actor.TypedIOPort">
> <property name="output"/>
> <property name="_location" class="ptolemy.kernel.util.Location" value="[480.0, 340.0]">
> </property>
> </port>
> <entity name="Display" class="ptolemy.actor.lib.gui.Display">
> <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={281, 691, 330, 237}, maximized=false}">
> </property>
> <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute" value="[322, 182]">
> </property>
> <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10">
> </property>
> <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
> </property>
> <property name="suppressBlankLines" class="ptolemy.data.expr.Parameter" value="false">
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong, Edward A. Lee</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Display actor reads tokens of any type via its input multiport, and displays each token on a separate line in a text display window.</p>
>
><p>Specify the size of the text display window with the rowsDisplayed and columnsDisplayed parameters. Simply resizing the window onscreen does not persistently change the size when the workflow is saved, closed, and then re-opened. </p>
>
><p>If the input is a string token, then the actor strips the surrounding quotation marks before displaying the value.</p>
>
><p>Select the suppressBlankLines parameter to specify that the actor not add blank lines to the display. By default, the actor will add blank lines.</p>
>
><p>Note: this actor can consume large amounts of memory. It is not advisable to use it to display large output streams.</p></configure></property>
><property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts tokens of any type.</configure></property>
><property name="prop:suppressBlankLines" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether the actor should display blank lines (the default) or suppress them.</configure></property>
><property name="prop:rowsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical size of the display, in rows. The value is an integer that defaults to 10.</configure></property>
><property name="prop:columnsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal size of the display, in columns. The value is an integer that defaults to 40.</configure></property>
><property name="prop:title" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The title of the text display window. If specified, the value will appear in the title bar of the text display window.</configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:7:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.gui.Display">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:883:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#TextualOutputActor">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#TextualOutput">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="[315.0, 465.0]">
> </property>
> </entity>
> <entity name="Add or Subtract" class="ptolemy.actor.lib.AddSubtract">
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>yuhong xiong and Edward lee</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The AddOrSubtract actor reads values via its two input ports (plus and minus), performs an add and/or subtract operation, and outputs the result.</p>
>
><p>The input ports are multiports, meaning that they can accept multiple inputs. Any values received via the plus port will be added; any values received via the minus port will be subtracted. Either port can be left unconnected. Leave the minus port unconnected to create a simple adder, for example. </p>
>
><p>Both of the input ports are polymorphic, accepting data of multiple types. The actor will automatically resolve the input type to the least upper bound of the presented values. For example, if the plus input port receives a Boolean value on one input channel and an integer on another, the resolved type will be a string, permitting the two inputs to be concatenated as strings. Note that strings cannot be subtracted. If the actor resolves an input type into a type that cannot be subtracted, it will generate an error.</p>
>
><p>The actor outputs the sum or difference and derives an output type based on the input values.</p></configure></property>
><property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the sum or difference of the inputs. The actor derives the output type based on the type of the inputs.</configure></property>
><property name="port:minus" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A muliport that accepts values to be subtracted. The actor automatically infers the input type based on the type of the input values.</configure></property>
><property name="port:plus" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A muliport that accepts values to be added. The actor automatically infers the input type based on the type of the input values.</configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:69:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.AddSubtract">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:944:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ArithmeticMathOperationActor">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#ArithmeticOperation">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="[335.0, 340.0]">
> </property>
> </entity>
> <entity name="Constant" class="ptolemy.actor.lib.Const">
> <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
> </property>
> <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
> </property>
> <property name="value" class="ptolemy.data.expr.Parameter" value="1">
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Constant actor outputs a constant, which is specified by the value parameter. By default, the actor outputs the integer 1.</p>
>
><p>The actor can be used to output other types of values, e.g., a string (such as "Hello") or a double (such as 1.2). The actor'
>s output type matches the type of the specified value.</p>
>
><p>NOTE: If using a PN Director, the 'firingCountLimit' parameter is often set to a finite integer (e.g. '1') so that the workflow will terminate. </p>
></configure></property>
><property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the specified constant. By default, the output is 1.</configure></property>
><property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.</configure></property>
><property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
><property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the Constant actor. By default, the value is the integer token 1. The value can be set to another type, e.g., a string (such as "Hello") or a double (such as 1.2). The output type matches the type of the value specified here.</configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:1:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.Const">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:877:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ConstantActor">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
> </property>
> <property name="kar" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:kar:57:1">
> </property>
> <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
> <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
> </property>
> <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="40">
> </property>
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{265, 280}">
> </property>
> </entity>
> <relation name="relation" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> <vertex name="vertex1" value="[205.0, 330.0]">
> </vertex>
> </relation>
> <relation name="relation2" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> </relation>
> <relation name="relation3" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> </relation>
> <link port="port" relation="relation"/>
> <link port="port2" relation="relation2"/>
> <link port="Display.input" relation="relation"/>
> <link port="Add or Subtract.plus" relation="relation"/>
> <link port="Add or Subtract.plus" relation="relation3"/>
> <link port="Add or Subtract.output" relation="relation2"/>
> <link port="Constant.output" relation="relation3"/>
> </entity>
> <entity name="Display" class="ptolemy.actor.lib.gui.Display">
> <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={659, 673, 330, 237}, maximized=false}">
> </property>
> <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute" value="[322, 182]">
> </property>
> <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10">
> </property>
> <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
> </property>
> <property name="suppressBlankLines" class="ptolemy.data.expr.Parameter" value="false">
> </property>
><property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
><property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong, Edward A. Lee</configure></property>
><property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
><property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Display actor reads tokens of any type via its input multiport, and displays each token on a separate line in a text display window.</p>
>
><p>Specify the size of the text display window with the rowsDisplayed and columnsDisplayed parameters. Simply resizing the window onscreen does not persistently change the size when the workflow is saved, closed, and then re-opened. </p>
>
><p>If the input is a string token, then the actor strips the surrounding quotation marks before displaying the value.</p>
>
><p>Select the suppressBlankLines parameter to specify that the actor not add blank lines to the display. By default, the actor will add blank lines.</p>
>
><p>Note: this actor can consume large amounts of memory. It is not advisable to use it to display large output streams.</p></configure></property>
><property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts tokens of any type.</configure></property>
><property name="prop:suppressBlankLines" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether the actor should display blank lines (the default) or suppress them.</configure></property>
><property name="prop:rowsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical size of the display, in rows. The value is an integer that defaults to 10.</configure></property>
><property name="prop:columnsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal size of the display, in columns. The value is an integer that defaults to 40.</configure></property>
><property name="prop:title" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The title of the text display window. If specified, the value will appear in the title bar of the text display window.</configure></property>
></property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:7:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.gui.Display">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:883:1">
> </property>
> </property>
> <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#TextualOutputActor">
> </property>
> <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#TextualOutput">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{450, 265}">
> </property>
> </entity>
> <relation name="relation" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> </relation>
> <relation name="relation2" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> </relation>
> <link port="Constant.output" relation="relation"/>
> <link port="CompositeActor.port" relation="relation"/>
> <link port="CompositeActor.port2" relation="relation2"/>
> <link port="Display.input" relation="relation2"/>
></entity>
>
>_______________________________________________
>Kepler-users mailing list
>Kepler-users at ecoinformatics.org
>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-users
------------
Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://www.eecs.berkeley.edu/Faculty/Homepages/lee.html
More information about the Kepler-users
mailing list