Easiest way to do this (IMHO):
The conceptual representation is to put all points as integers. In Clips the clear positions have NO fact with them. The only facts are the WALL clips.
I wrote this this over this past weekend. Use Java to display a map (0,0) to (25,25) with most clear points and just one short wall of Ws. The Java representation uses a int matrix for the points. Black color is wall, target is red, ... I have the Java main program set up the facts for original and target points. As well as the wall points.
I have Java use the CLIPSJNI lib (open source at sourceforge).
The Java main calls the CLIPSJNI lib and executes one rule, then Java runs again and get results of the rule that ran (have Clips rule write results to a defglobal), and Java main then retrieves the data and updates the map on the screen.
(deftemplate point
(slot pType (type SYMBOL)
(allowed-symbols original wall current previous target history))
(slot x (type INTEGER))
(slot y (type INTEGER))
(slot n (type INTEGER))
At this point I have a nice movement going of the robot from the original point to the target point. Though at this point the robot is going through the walls !!! I am working on the adjacent-to-wall rules (one for each direction).
The n (integer) slot is for a history of the current robot position. Therefore I keep a series of these and am using them to play with slope values (local and overall) during the path search.
I need to keep playing with this project.
Ronald Finkbine
ronaldf...@hotmail.com