X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/e800bc42e811087efc35350d5bfaa97cd1926d88..9d2694b6708c33f0eeb0537032687872e0056e4b:/trunk/src/breve/Celdas.tz diff --git a/trunk/src/breve/Celdas.tz b/trunk/src/breve/Celdas.tz index ce5d511..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,17 +316,17 @@ 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. } if (plan_finished): { - self update-entorno. sa plan. # Si no tenemos plan, lo hacemos plan_finished = 0. # TODO posicion_inicial = posicion_actual @@ -340,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"): { @@ -378,15 +376,12 @@ CeldasLightVehicle : CeldasVehicle (aka CeldasVehicles) { if (iterate == CELDAS_TURNO): { - self update-entorno. # 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.