;;this file is a file for helping to use the command in clisp environment
;;to use the RAP

;;to load the RAP environment type(or copy ;) ):
(load "load-all.lisp")
(load-all)

;;to load the cognitiv robotics project environment type:
(execute-goal '(factory-world-2))
(execute-goal '(init))

;;if the robot should execute the first example:
(execute-goal '(factory-world-1))
;;before starting, the factorys must be running 
;;to start the factory "lager" type on the command shell:
>factory lager

;;the factory tasks to execute are in the file factory.raps

;;if the robot should do a delivery type:
(execute-goal '(delivery Paket 6 0))
;;(the two numbers are a position on the fild if both are even ther 
;;is a station(two crossing roads), if both are odd ther is nothing to drive on)

;;if the robot should do a go enywher type:
(execute-goal '(goto 2 4))

;;to unblock a position on the fild:(nlock is simular)
(execute-goal '(unblock 4 3) 100)

;;to do singular actions:
(execute-goal '(move-next-station))
(execute-goal '(turn-left-to S))

;;to empty the RAP memory:
(reset-memory)

;;to show more details of RAP in exicution:
(set-show-level :memory) :high)

;;if you want to ask something for:
(memory-ask query)
(memory-ask '(rob-direction ?x))
(memory-ask '(factory ?x ?y lager ?w ?a1 ?a2 ?a3 ?a4 ?a5 ?a6))
(memory-ask '(robot-holds ?wich ?number))

;;some more RAP functions:
(command-turn-right)
(A-star1 2 2 0 (list (list nil 0 0 0)))

;;example to execute:
;;type in seperate shell windows:
>factory ./fac1
>factory ./lager
;;then start lisp in a other window and start the rap part:(with files of folder ./com-no/ in the actual folder ./)
>lisp
(load "load-all.lisp")
(load-all)
(execute-goal '(factory-world-1))
(execute-goal '(init))
;;if the robot should now care that the factory produces 3 items type:
(execute-goal '(factory-1 3))




