-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathONTOLOGIA_vf.sysml
More file actions
183 lines (161 loc) · 4.77 KB
/
ONTOLOGIA_vf.sysml
File metadata and controls
183 lines (161 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
package adapted_robot_ontology {
// Clases principales (Partes)-----------------------------------------------------------------
part def Robot :> Entity {
attribute def id :> int;
attribute def xpos :> double;
attribute def ypos :> double;
attribute def angle :> double;
}
part def Engine :> Entity {
attribute def name :> string;
attribute def max_speed :> double;
attribute def consumption :> double;
attribute def type :> string;
}
part def Battery :> Entity {
attribute def charge :> double;
}
part def Task :> Process {
attribute def name :> string;
attribute def complexity :> string;
attribute def description :> string;
}
part def Configuration :> Process {
}
part def PatrolConfig :> Configuration {
attribute def patrol_time :> double;
attribute def move_distance :> double;
attribute def patrol_speed :> double;
}
part def NavigateConfig :> Configuration {
attribute def target_x :> double;
attribute def target_y :> double;
attribute def navigation_speed :> double;
}
part def State :> Entity {
attribute def name :> string;
attribute def description :> string;
}
// Conexiones (Relaciones entre entidades)------------------------------------------------------
connection def has_task {
end domain : Robot;
end range : Task;
}
connection def uses_engine {
end domain : Robot;
end range : Engine;
}
connection def has_battery {
end domain : Robot;
end range : Battery;
}
connection def behaves {
end domain : Robot;
end range : State;
}
connection def has_patrol_config {
end domain : Robot;
end range : PatrolConfig;
}
connection def has_navigate_config {
end domain : Robot;
end range : NavigateConfig;
}
//Instancias -----------------------------------------------------------------------
instance motorA : Engine {
name = StandardMotor;
max_speed = 0.10;
consumption = 35.0;
type = electric;
}
instance motorB : Engine {
name = HighPerformanceMotor;
max_speed = 0.12;
consumption = 50.0;
type = electric;
}
instance batA : Battery {
charge = 100.0;
}
instance batB : Battery {
charge = 85.0;
}
instance idle : State {
name = idle;
description = The system is in low-power, non-operational condition
}
instance recovery : State {
name = recovery;
description = The system has encountered an issue and is attempting to troubleshoot or recover
}
instance patrolling : State {
name = task execution;
description = The system is performing a patroling task
}
instance navigating : State {
name = task execution;
description =The system is performing a navigating task
}
// Instancia de Task: tarea 1
instance patrol : Task {
name = Controlled patroling
complexity = Simple
description = Controlled patrolling on the map
}
// Instancia de Task: tarea 2
instance navigation : Task {
name = Navigate to destination
complexity = High
description = Move the agent to a specific location avoiding obstacles
}
instance patrol1 : PatrolConfig {
patrol_time = 120.0;
move_distance = 0.2;
patrol_speed = 0.14;
}
instance patrol2 : PatrolConfig {
patrol_time = 30.0;
move_distance = 0.5;
patrol_speed = 0.05;
}
instance navigate1 : NavigateConfig {
target_x = 0.5;
target_y = -0.5;
navigation_speed = 0.04;
}
instance navigate2 : NavigateConfig {
target_x = -0.3;
target_y = 0.3;
navigation_speed = 0.06;
}
// Instancia del Robot
instance robot1 : Robot {
id = 1;
xpos = 0.0;
ypos = 0.0;
angle = 0.0;
uses_engine = motorA
has_battery = batA
has_task = patrol
has_patrol_config = patrol1
}
// Instancia del Robot
instance robot2 : Robot {
id = 2;
xpos = 0.0;
ypos = 0.3;
angle = 0.0;
uses_engine = motorB
has_battery = batB
has_task = navigation
has_navigate_config = navigate2
}
rule def doPatroling {
if Robot(?r) and PatrolConfig(?p) and has_patrol_config(?r,?p)
then behaves(?r,patrolling)
}
rule def doNavigating {
if Robot(?r) and NavigateConfig(?n) and has_navigate_config(?r,?n)
then behaves(?r,navigating)
}
}