Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ontologies Reasoning Components Agents Simulations Homework Assignment 1: Modeling the Tangram Puzzle in UML and OCL Jacques Robin & Franklin Ramalho.

Similar presentations


Presentation on theme: "Ontologies Reasoning Components Agents Simulations Homework Assignment 1: Modeling the Tangram Puzzle in UML and OCL Jacques Robin & Franklin Ramalho."— Presentation transcript:

1 Ontologies Reasoning Components Agents Simulations Homework Assignment 1: Modeling the Tangram Puzzle in UML and OCL Jacques Robin & Franklin Ramalho

2 2 The Tangram Puzzle Specification The Tangram Puzzle Specification  A set I i of polygon instances from a set of polygon sub-classes P i lay on a table in an initial random configuration  I i is partitioned into:  Atomic polygon instances that are made of a single piece  Compound polygon instances that result from joining several polygons by laying them on the table in positions such that their sides are aligned in contact which each other  A compound polygon instance generally belongs to a different class than its atomic (or recursively compound) components  A configuration is defined solely by:  The number of instances of each polygon class laying on the table  Which sides of this instance set are in contact (i.e., joined) to form compound polygons  The puzzle consists in disjoining and joining some of these polygons to assemble on the table another goal set of polygons instances I g taken from a possible distinct goal set of polygon sub-classes P g

3 3 The Tangram Puzzle Specification The Tangram Puzzle Specification  The puzzle is executed by an robotic agent:  Which sensors provide full information on about:  How many instances of each polygon class lay on the table,  Which of these instances are atomic and compound, and  For compound polygons what is their recursive decomposition in sub- components, sub-sub-components etc. until the bottom embedding level of atomic components.  Which actuators allow moving one atomic polygon either:  From a position where it is joined with another polygon (atomic or compound) to form a third compound polygon to a position where it is alone, disjoint from any other polygon  From such an isolated position, to a position where it is joined with another polygon (atomic or compound) to form a third compound polygon

4 4 Revision of Polygonal Geometry  http://www.mathleague.com/help/geometry/polygons.htm#polygon http://www.mathleague.com/help/geometry/polygons.htm#polygon  http://www.math.com/tables/geometry/polygons.htm http://www.math.com/tables/geometry/polygons.htm What is a Polygon? A closed plane figure made up of several line segments that are joined together. The sides do not cross each other. Exactly two sides meet at every vertex. TypesTypes | Formulas | Parts | Special Polygons | NamesFormulasPartsSpecial PolygonsNames Types of Polygons Regular - all angles are equal and all sides are the same length. Regular polygons are both equiangular and equilateral. Equiangular - all angles are equal. Equilateral - all sides are the same length. Convex - a straight line drawn through a convex polygon crosses at most two sides. Every interior angle is less than 180°. Concave - you can draw at least one straight line through a concave polygon that crosses more than two sides. At least one interior angle is more than 180°. Polygon Formulas (N = # of sides and S = length from center to a corner) Area of a regular polygon = (1/2) N sin(360°/N) S 2 Sum of the interior angles of a polygon = (N - 2) x 180° The number of diagonals in a polygon = 1/2 N(N-3) The number of triangles (when you draw all the diagonals from one vertex) in a polygon = (N - 2) Polygon Parts Side - one of the line segments that make up the polygon.Vertex - point where two sides meet. Two or more of these points are called vertices.Diagonal - a line connecting two vertices that isn't a side.Interior Angle - Angle formed by two adjacent sides inside the polygon.Exterior Angle - Angle formed by two adjacent sides outside the polygon. Side - one of the line segments that make up the polygon.Vertex - point where two sides meet. Two or more of these points are called vertices.Diagonal - a line connecting two vertices that isn't a side.Interior Angle - Angle formed by two adjacent sides inside the polygon.Exterior Angle - Angle formed by two adjacent sides outside the polygon. Special Polygons Special Quadrilaterals - square, rhombus, parallelogram, rectangle, and the trapezoid. Special Quadrilaterals Special TrianglesSpecial Triangles - right, equilateral, isosceles, scalene, acute, obtuse. Polygon Names Generally accepted names SidesSides NameName n N-gonN-gon 3 TriangleTriangle 4 QuadrilateralQuadrilateral 5 PentagonPentagon 6 HexagonHexagon 7 HeptagonHeptagon 8 OctagonOctagon 1010 DecagonDecagon 1212 DodecagonDodecagon Names for other polygons have been proposed. SidesSides NameName 9 Nonagon, Enneagon Nonagon, Enneagon

5 5 Example of Tangram Puzzle Input: Initial and Goal Configurations  Initial configuration:  Two convex quadrilaterals  Each one assembled from one equilateral triangle joint with a right triangle on the opposite side of the right angle triangle  Goal configuration:  One convex hexagon, assembled from two equilateral triangles and one square  where the square is itself recursively assembled from two right triangles

6 6 Example of Tangram Puzzle Output: Sequence of Actions ET1 RT1 ET2 RT2 ET1 RT1 ET2 RT2 ET1 RT1 ET2 RT2 Move ET2 from RT2 to Table ET1 RT1 ET2 RT2 Move RT2 from Table to RT1 Move ET2 from Table to RT2

7 7 Topic Variations and Allocation  Roster divided in teams of at most 5 students  Each team chooses one of the following topic variations:  Topic 1:  Atomic sub-classes: only triangles  Input sub-classes: any convex polygon of at most 8 sides  Goal sub-classes: any convex polygon of at most 8 sides  Topic 2:  Atomic sub-classes: any convex polygon of at most 6 sides  Input sub-classes: any convex polygon of at most 6 sides  Goal sub-classes: any convex polygon of at most 6 sides  Topic 3:  Atomic sub-classes: any regular convex polygon of at most 10 sides  Input sub-classes: any regular convex polygon of at most 10 sides  Goal sub-classes: any regular convex polygon of at most 10 sides

8 8 Topic Variations and Allocation  Topic 4:  Atomic sub-classes: only right triangles  Input sub-classes: any right convex polygon of at most 8 sides  Goal sub-classes: any right convex polygon of at most 8 sides  Topic 5:  Atomic sub-classes: only triangles  Input sub-classes: any concave polygon of at most 12 sides  Goal sub-classes: any concave polygon of at most 12 sides  Topic 6:  Atomic sub-classes: any regular concave polygon of at most 8 sides  Input sub-classes: any regular concave polygon of at most 8 sides  Goal sub-classes: any regular concave polygon of at most 8 sides  Topic 7:  Atomic sub-classes: only triangles  Input sub-classes: any regular convex polygon of at most 6 sides  Goal sub-classes: any regular concave polygon of at most 8 sides

9 9 Artifacts to Constructs  Ontology of the relevant polygon classes as an UML class diagram associated with OCL invariants and defaults  Test set of input pair configurations (initial configuration and corresponding goal configuration) as a set of UML object diagram pairs  Robotic agent’s structural model as an UML class diagram with OCL invariants and defaults  Robotic agent’s behavioral model as OCL bodies, derivation rules and method pre and post conditions


Download ppt "Ontologies Reasoning Components Agents Simulations Homework Assignment 1: Modeling the Tangram Puzzle in UML and OCL Jacques Robin & Franklin Ramalho."

Similar presentations


Ads by Google