-// @Check
-// def checkOnlyOneBehaviourPerMissionEmptyTakeControl(Mission m) {
-// var List<String> empty = new LinkedList<String>();
-// var List<String> all = new LinkedList<String>();
-// for(Behaviour b : m.behaviours){
-// if(b.tc == null){
-// empty.add(b.name);
-// }
-// all.add(b.name);
-// }
-// if(empty.size > 1){
-// warning("Multiple behaviours without takeControl predicate. You might want to remove some of: " + empty.toString(), m.eContainingFeature);
-// }
-// if(all.toSet().size() < all.size()){
-// warning("You have duplicate behaviours.", m, TaskDSLPackage.Literals::MISSION__BEHAVIOURS);
-// }
-// }
+ @Check
+ def checkRobot(Robot r){
+ if(r.acc == 0){
+ warning("Acceleration set to zero, this could lead to non moving robot", null);
+ }
+ if(r.spd == 0){
+ warning("Acceleration set to zero, this could lead to non moving robot", null);
+ }
+ }
+
+ @Check
+ def checkBehavioursl(Mission m) {
+ var List<String> empty = new LinkedList<String>();
+ var List<String> all = new LinkedList<String>();
+ var List<String> warned = new LinkedList<String>();
+ for(Behaviour b : m.behaviours){
+ if(b.tc == null){
+ empty.add(b.name);
+ }
+ if(all.contains(b.name) && !warned.contains(b.name)){
+ warning("Behaviour '" + b.name + "' multiple times in the behaviourlist.", null);
+ warned.add(b.name);
+ }
+ all.add(b.name);
+ }
+ if(empty.size() > 1){
+ warning("Multiple behaviours without takeControl predicate. You might want to remove some of: " + empty.toString(), null);
+ }
+ }