I've attached a simple model that worked in Kepler 2.3 and does not work
in 2.4 or the trunk. The stack trace of the error is below. I can make
the model work by either
1. inserting a constraint into the constructor for
ptolemy.domains.sdf.lib.Repeat as follows: output.setTypeAtLeast(input)
or
2. configuring the output port of the Repeat actor and setting its type
to object.
I am not really interested in just fixing this workflow, I am interested
in understanding what changed between Kepler 2.3 and 2.4 that introduces
the exception and whether this is expected behavior. It seems to me
that the _defaultTypeConstraints() for the TypedAtomicActor is still
setting an inequality constraint for any TypedAtomicActors ports
combinations where neither the input nor the output has its type set.
This inequality constraint appears to require the output type to be
greater than or equal to the types of any input ports as long as neither
port type has been set.
I don't see how the output port of repeat ever gets set to general. For
what it's worth, I don't see the same problems if I pass another type
through the Repeat actor. The output type is set to the type of the
input and the workflow executes correctly. I only see the problem when
I pass an object token through the Repeat actor. I'd appreciate any
insight you can provide.
Thanks,
Scott
ptolemy.actor.TypeConflictException: Type conflicts occurred in
.RepeatTypeCheck on the following inequalities:
(port .RepeatTypeCheck.Repeat.output: general) <= (port
.RepeatTypeCheck.Image Display.input: object(null))
at
ptolemy.actor.TypedCompositeActor.resolveTypes(TypedCompositeActor.java:401)
at ptolemy.actor.Manager.resolveTypes(Manager.java:1151)
at ptolemy.actor.Manager.preinitializeAndResolveTypes(Manager.java:987)
at ptolemy.actor.Manager.initialize(Manager.java:661)
at ptolemy.actor.Manager.execute(Manager.java:340)
at ptolemy.actor.Manager.run(Manager.java:1202)
at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1760)
--
Scott Zimmer
[email protected]
512-299-7218
<?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="RepeatTypeCheck" class="org.kepler.moml.CompositeClassEntity">
<display name="RepeatTypeCheck"/>
<property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:48078:18:3">
</property>
<property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
<property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
</property>
</property>
<property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="10.0.devel">
</property>
<property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:uuid:2a43386a-d732-4b0d-ae78-7f1d38710a4e:6:27:urn:lsid:uuid:12850d7c-9c79-4df6-8827-50c823559d8a:12:2:urn:lsid:uuid:12850d7c-9c79-4df6-8827-50c823559d8a:13:1:urn:lsid:kepler-project.org/ns/:48078:9:36">
</property>
<property name="Sequential Conductor" class="ptolemy.domains.sdf.kernel.SDFDirector">
<property name="iterations" class="ptolemy.data.expr.Parameter" value="1">
</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="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>If you are using this conductor inside a loop, or iterate over array component be sure to set the iterations to either "0" for unlimited iterations or iterations that are controlled by another component or set it to a number greater than zero to perform that number of iterations.</p> <p>The Sequential Conductor 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 Sequential Conductor 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 Sequential Conductor 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 Sequential Conductor 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 Sequential Conductor 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 Sequential Conductor's allowDisconnectedGraphs parameter may also be set to true. The Sequential Conductor 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 Sequential Conductors 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 Sequential Conductor 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 Sequential Conductor 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 Sequential Conductor because the number of tokens on each output can change for each execution.</p> <p>Unless otherwise specified, the Sequential Conductor 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 ONE which is the same as "1". 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 Sequential Conductor 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 Sequential Conductor, 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 Sequential Conductor 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 Sequential Conductor 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: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: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: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:uuid:12850d7c-9c79-4df6-8827-50c823559d8a:11: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="[515.0, 810.0]">
</property>
<property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:director:1:1">
</property>
</property>
<property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={339, 117, 921, 657}, maximized=false}">
</property>
<property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 495]">
</property>
<property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="0.6400000000000001">
</property>
<property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{756.0, 1002.5}">
</property>
<entity name="Image Reader" class="ptolemy.actor.lib.image.ImageReader">
<property name="fileOrURL" class="ptolemy.data.expr.FileParameter" value="$CLASSPATH/doc/img/PtolemyII.jpg">
</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>Christopher Hylands</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 ImageReader actor reads an image path (e.g., C:\pictures\signature.jpg), and outputs it as an image token, which can be displayed and/or manipulated by other Kepler actors, such as ImageRotate or ConvertImageToString.</p> <p>Currently, the actor only reads image paths via a parameter. To read and convertn an image path to an image token via an input port, use the ConvertURLToImage actor.</p></configure></property>
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts an image token.</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:fileOrURL" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The file name or URL of the image to be read. See FileParameter for more information about specifying file names.</configure></property>
</property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:48078:10:1">
</property>
<property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.image.ImageReader">
<property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:978:1">
</property>
</property>
<property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ImageManipulationActor">
</property>
<property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#LocalInput">
</property>
<property name="_location" class="ptolemy.kernel.util.Location" value="[665.0, 945.0]">
</property>
<property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:104:1">
</property>
<port name="trigger" class="ptolemy.actor.TypedIOPort">
<property name="input"/>
<property name="multiport"/>
<property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
</property>
</port>
</entity>
<entity name="Image Display" class="ptolemy.actor.lib.image.ImageDisplay">
<property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={606, 196, 388, 507}, maximized=false}">
</property>
<property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute">
</property>
<property name="_pictureSize" class="ptolemy.actor.gui.SizeAttribute" value="[372, 447]">
</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>James Yeh, 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 Image Display actor reads an image token and displays the image on the screen.</p> <p>If the actor receives a sequence of images that are all the same size, it will continually update the display with the new data. If the size of the input image changes, the actor generates a new picture display. </p> <p>Image tokens can be generated from image URLs with the ImageReader or the ConvertURLToImage actors.</p> </configure></property>
<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts image tokens to display. Use the ImageReader or ConvertURLToImage actors to create an image token from a specified image path.</configure></property>
</property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:103:1">
</property>
<property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.image.ImageDisplay">
<property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:977:1">
</property>
</property>
<property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ImageManipulationActor">
</property>
<property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GraphicalOutput">
</property>
<property name="_location" class="ptolemy.kernel.util.Location" value="[970.0, 960.0]">
</property>
</entity>
<entity name="Repeat" class="ptolemy.domains.sdf.lib.Repeat">
<property name="numberOfTimes" class="ptolemy.actor.parameters.PortParameter" value="2">
</property>
<property name="blockSize" 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>Shankar Rao, 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 Repeat actor reads and repeats a "block" of tokens (i.e., one or more tokens of any type). The actor outputs the block a user-specified number of times.</p> <p>Specify the block size with the blockSize parameter and the number of times to repeat the block with the numberOfTimes parameter. Note: because the actor reads multiple input tokens at each iteration, it causes a sample rate increase by a factor of numberOfTimes, and hence affects the number of invocations of downstream actors. </p> </configure></property>
<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An input port that accepts tokens of any type. Specify the number of tokens to read at each iteration with the blockSize parameter.</configure></property>
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the block of tokens the specified number of times. Specify the number of times to repeat the output with the numberOfTimes parameter.</configure></property>
<property name="prop:blockSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of tokens in a block. The value is an integer and must be greater than zero. The default is 1. </configure></property>
<property name="prop:numberOfTimes" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The repetition factor. The value is an integer and must be greater than 0. The default is 2. </configure></property>
</property> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:364:1">
</property>
<property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.domains.sdf.lib.Repeat">
<property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1130:1">
</property>
</property>
<property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ControlActor">
</property>
<property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowControl">
</property>
<property name="_location" class="ptolemy.kernel.util.Location" value="{830, 960}">
</property>
</entity>
<relation name="relation" class="ptolemy.actor.TypedIORelation">
</relation>
<relation name="relation2" class="ptolemy.actor.TypedIORelation">
</relation>
<link port="Image Reader.output" relation="relation"/>
<link port="Image Display.input" relation="relation2"/>
<link port="Repeat.input" relation="relation"/>
<link port="Repeat.output" relation="relation2"/>
</entity>
_______________________________________________
Kepler-dev mailing list
[email protected]
http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev