• Aucun résultat trouvé

Diagonal Trajectories

Chapter 5 The Tester

QCS Generator

Simulator Tester

Motion Types

Interaction Library OK FAIL

Parametric Models &

Constraints Sketch

& Desired Behavior

QC-Space

5.1 Current Implementation

During the reverse engineering and generalization process, SketchIT's job is to determine what behavior each piece of the sketch ought to provide. It does this by searching for a qc-space description of the sketch that provides the desired overall behavior.

Chapter 3 described the qc-space generator, which produces a sequence of candi-date qc-spaces for the sketch. Each of these candicandi-dates describes one set of possible behaviors for each part of the sketch.

A qc-space is an implicitdescription of behavior: qc-space describes the kinematics of the device, that is, it describes all possible positions the device's parts can occupy.

Chapter 4 described the simulatorSketchIT uses to make explicit the behavior of a candidate qc-space. The simulator computes all possible motions the device's parts can exhibit in response to the external inputs specied by the state transition diagram. The simulator computes the simulation in a piecewise fashion: it simulates

105

each arc of the state transition diagram individually.

This chapter describes the tester that SketchITuses to compare the simulated behavior of a candidate qc-space to the desired overall behavior. Because the simula-tor simulates each arc individually, the tester's job is to determine if the simulation of one arc reaches the initial conditions of the next arc, and so on. If so, the candidate qc-space is capable of producing the desired behavior and is accepted.

Because the simulator computes all possible behaviors, the simulation of any par-ticular arc may branch. Hence the simulation of a single arc may reach several possible terminal states. To determine if the simulation of one arc reaches the initial condi-tions of the next, the tester matches each of the terminal states of one arc against the specied initial state of the next (i.e., to next node in the state transition diagram).

Two states match if the same pairs of faces are engaged and the same springs are relaxed in the both states. The tester requires that all of the terminal states of one arc match the initial state of the next. Otherwise it rejects the candidate qc-space because in this case the device is capable of producing at least one behavior that does not match the desired behavior.

5.2 A More Powerful Tester

The tester described above is the simplest implementation adequate for the examples we explored. This section describes how we would construct a more powerful tester.

One of the features of this more powerful tester is that it will support a richer behavior specication language. This section begins by describing this richer specication language.

5.2.1 Extending the Behavior Specication Language

We specify the desired behavior of a device with a state transition diagram. In the current implementation, each node in the diagram is a list of the pairs of faces that are engaged and the springs that are relaxed. The pairs of faces not listed at a node are by default disengaged, the springs not listed are by default not relaxed. The arcs are the external inputs that drive the device.

The more powerful tester will allow additional choices for specifying the states of engagement faces and springs at a node. Engagement faces will be either engaged, not engaged, or unspecied. Similarly, springs will be either stretched, relaxed, com-pressed, or unspecied.

The designer will be able to annotate arcs to specify a desired state for springs and engagement faces during a transition. For example, the designer may specify that a particular pair of faces should remain not engaged during a particular transition.

Finally, the designer will be able to specify partially ordered states, that is, a set of states that can occur in any order.

5.2. A MORE POWERFUL TESTER 107

5.2.2 Extending the Tester

The current tester assumes that, after one set of inputs is applied, the device reaches steady state before the next set is applied. This assumption is appropriate for the examples we explored, but is in general too restrictive.

A better approach is for the tester to monitor each branch of the simulation to determine when the state in that branch reaches the next node in the state transition diagram. When this happens, the simulator will instruct the simulator to apply the next set of inputs to that branch.

If all of the branches pass through the desired set of states (i.e., the nodes in the state transition diagram) in the desired order, the qc-space will surely provide the desired behavior and will be accepted.

If some of the branches pass through the desired states in the desired order, while others do not, the qc-space is capable of providing the desired behavior only for specic choices of masses, springs, and actuators. Numerical simulation can be used to verify the design once these choices have been made. Hence, we can use qualitative simulation for conceptual design and progress to more precise numerical techniques (which are more computationally expensive) as more of the design details are selected.

An alternative approach would be to construct additional constraints on the masses, springs, and actuators that ensure that only the desirable branches of the simulation are possible. These constraints would be added to the BEP-Models computed from the qc-space.

Chapter 6