X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/67313a2810725e22a565b9af13d4de2f94a51426..9d2694b6708c33f0eeb0537032687872e0056e4b:/trunk/src/breve/Celdas.tz?ds=inline diff --git a/trunk/src/breve/Celdas.tz b/trunk/src/breve/Celdas.tz index 2998cb9..7c1afdc 100644 --- a/trunk/src/breve/Celdas.tz +++ b/trunk/src/breve/Celdas.tz @@ -8,6 +8,7 @@ @define CELDAS_MAX_VELOCITY 30. @define CELDAS_TURNO 100. +@define CELDAS_SENSOR_THRESHOLD 9. PhysicalControl : CeldasControl { % This class is used for building simple vehicle @@ -55,7 +56,6 @@ MultiBody : CeldasLightVehicle (aka CeldasLightVehicles) { bodyLink (object). wheels (list). - sensors (list). + to init: bodyShape = new Shape. @@ -316,13 +316,12 @@ CeldasLightVehicle : CeldasVehicle (aka CeldasVehicles) { sa update-datos-finales with datos-finales. +to iterate: - fl, fr(float). - self update-entorno. if (0): # TODO posicion_final == posicion_actual { print "Llegamos al FINAL!!!". + self set-global-velocity to 0. return. } @@ -341,10 +340,8 @@ CeldasLightVehicle : CeldasVehicle (aka CeldasVehicles) { if (iterate == 0): { - print "iteracion 0". if (sa has-next-theory): { - print "hay teoria". teoria = sa get-next-theory. if ((teoria get-accion) == "adelante"): { @@ -382,11 +379,9 @@ CeldasLightVehicle : CeldasVehicle (aka CeldasVehicles) { # TODO if (posicion_actual == posicion_inicial): movido = false. else movido = true. if (sa validate theory teoria): { - print "valida". } else { - print "Teoria no valida". plan_finished = 1. } } @@ -526,7 +521,7 @@ Link : CeldasSensor (aka CeldasSensors) { val (float). val = self get-data. - if (val > 10): return 0. + if (val > CELDAS_SENSOR_THRESHOLD): return 0. else return 1. #+ to iterate: @@ -535,16 +530,10 @@ Link : CeldasSensor (aka CeldasSensors) { i (object). min,dist (float). v,obs(vector). - aux(float). j (int). des2,des3(int). wallBegin,wallEnd,wallCenter (float). - - toObstacle(vector). - largeWall (float). - obsLoc (vector). - location (vector). posObstacle,destiny,yo(vector). draw clear.