Re: Constraints

Jean-Francis Balaguer (balaguer@artemedia.ch)
Wed, 07 May 1997 16:59:53 +0200

Stephan Diehl wrote:
>
First, sorry for answering so late, but sometimes we are too busy to
answer the mail that is not of super high priority.

> My first impression is that if we have dynamic routing,
> i.e. we can route to nodes passed as fields
> or events, we can do part of what Balaguer does.

> His connector objects are similar to connection
> classes in VRML++. But constraints can propagate
> values in either way, while routes only one-way
> connections.
>

I would like to comment out a bit here First, I would like to
give context. In the following, constraints refers to local propagation
constraints. They can be only satisfied or unsatisfied and are not
able to handle cycles

To some extents, VB2 shares some design elements with
VRML. A VB2 world is composed of objects (nodes) arranged in a tree
(graph). Objects (nodes) stores their data in slots (fields).
Constraints can be used to maintain a relationship between a group
of slots that can be in different objects. Constraints are part of
the behavior of their owner and are inherited by subclasses.
Constraints are multidirectional (can be evaluated all ways),
constraints have priorities to resolve conflicts when trying to
evaluate the same slot. Constraints can refer to slots through paths
that are objects able to compute the location of a slot by evaluating
a function that will depend on other slots. Each time, the value of
one of these slot changes, the path is marked outofdate, the constraint
is removed from the slot it was computing before, the paths are
reevaluated and the constraint is reinserted in the constraint graph
is all paths have been evaluated successfully. On the other sides,
demons can be triggered to perform imperative actions each time
the value computed by a path changes. This behaviors are part of the
core behavior of the system. In summary, path invalidation/recomputation
are driving the system. Higher-order control (constraints that
control other constraints) is obtained throug paths.

Objects can be enriched with behaviors for animation or interaction.
Controllers (think of it as a collection of interpolators and a
timesensor encapsulated in an object with a declared interface)
allows the animation of an object, while tools enpower the object with
a specific displaz of the object slots and with a UI metaphor to
manipulate the object. Composition of behaviors is obtained through
some kind
of plug'n'play system where tools and controller can connect to an
object if and only the tool/controller data interface matches
that of the object. In practice, we need to find some slots on the
object.

The connection logic is encapsulated into the connector object
that is owned by the tool/controller. The connector encapsulates
a set of connecting constraints whose role is to allow bidirectional
information propagation between the object and the tool/controller.

The plug'n'play behavior is obtained as follows. A connector has two
special slots (the binding slots) that contains the connected object
and the tool. Connecting a tool to an object is obtained by setting
the value of the binding slot on the object side of the connector
to the desired object to connect.

All binding constraints tries to insert themselves in the graph by
reevaluting their paths that is dependent on the modified slot. If all
paths are inserted correctly, then the object matches the connector's
slot interface and then the connection is active. Otherwise, all
binding constraints are deactivated and the binding slot is set back
to NULL.

I think I gave you a fairly indepth view of the VB2 system. In a next
message, I will explain why Amulet is even better and why we should
use it as the basis for some proposal to make VRML more OO.

-- 
_____________________________________________________________________________
Jean-Francis Balaguer     
Technology Manager 3D/VRML      
Artemedia Online SA             e-mail: balaguer@artemedia.ch    
rue de Morges 24                   tel: +41 21-706-2084 fax: +41
21-706-2071
1023 Crissier - Switzerland        www:
http://www.artemedia.ch/~balaguer/