Hello.

I get the next error:
Jess reported an error in routine >
while executing (> ?yb ?c1b)
while executing 'test' CE
while executing rule LHS (Node2)
while executing rule LHS (Node2)
while executing rule LHS (Node2)
while executing rule LHS (Node2)
while executing rule LHS (Node2)
while executing rule LHS (Node2)
while executing rule LHS (Node2)
while executing rule LHS (TEQ)
while executing rule LHS (TECT)
while executing (modify ?fase (es "jugar"))
while executing defrule MAIN::control-nulo
while executing (run).

Message: Not a number: nil.

------

 

I´m trying do:

 

(deffacts robots_ball

(yo_ball (fetch "difyo_ball"))

(yo_myport (fetch "difyo_myport"))

(yo_suport (fetch "difyo_suport"))

(comp1_ball (fetch "distcomp_ball1"))

(comp2_ball (fetch "distcomp_ball2"))

(comp1_yo (fetch "distcomp_yo1"))

(comp2_yo (fetch "distcomp_yo2"))

(comp1_miport (fetch "distcomp_miport1"))

(comp2_miport (fetch "distcomp_miport2"))

(comp1_suport (fetch "distcomp_suport1"))

(comp2_suport (fetch "distcomp_suport2"))

)

;;;

(defrule control-nulo

(declare (salience 1000))

(fase (es "nil3"))

(comp1_ball ?c1b)

(comp2_ball ?c2b)

(test (neq nil ?c1b))

(test (neq nil ?c2b))

?fase

=>

(printout t "Ninguno de los sensores es nil" crlf)

(modify ?fase(es "jugar"))

)

;;;

(defrule portero0 "portero si soy el que está mas lejos de la pelota y más 
cerca de la portería de todos mis compañeros"

(declare (salience 500))

(fase (es "jugar"))

(yo_ball ?yb)

(yo_myport ?yp)

(comp1_miport ?c1p)

(comp2_miport ?c2p) 

(comp1_ball ?c1b)

(comp2_ball ?c2b)

(sensores(mi_porteria_x ?mpx)(mi_porteria_y ?mpy)(num_jugador ?nj))

(test (> ?yb ?c1b))

(test (> ?yb ?c2b))

(test (

(test (

?mover









=>



(printout t "SOY EL PORTERO AHORA" ?nj crlf)

(modify ?mover(eje_x ?mpx)(eje_y ?mpy)(velocidad 1)(chutar 0))

(assert (portero))

)

 

;;;

 

And I´m calling from JAVA with:
for(i = 1; i length+1; i++){ 


cadena2= "distcomp_ball" + i;

Vec2 aux = new Vec2 ( teammates[i-1].x - ball.x, teammates [i-1].y - ball.y);
jess_engine.store(cadena2, new Value (aux.r, RU.FLOAT));


} 

 

Then, if I use 

;;;(test (neq nil ?c1b))

;;;(test (neq nil ?c2b))

 

I get the error as stated above and if i use without ;;; (comments), I get in 
JAVA a fatal error and it doesn´t work:
Exception in thread "Thread-2" java.lang.NullPointerException
at Player.TakeStep(Player.java:212)
at 
EDU.gatech.cc.is.abstractrobot.ControlSystemS.takeStep(ControlSystemS.java:127)
at TBSim.SimulationCanvas.run(SimulationCanvas.java:971)

at java.lang.Thread.run(Unknown Source)

----------------

I don´t why is it going on!!! Any help or suggestion?

Thanks for all.

Ricardo.
                 TERRA 

-->

Reply via email to