Ground examples

This include 2 examples in the ground environment, one is in a "Ground" Protege project (Ground.pprj, Ground.pont and Ground.pins files)
and one is in a "Remote" Protege project (Remote.pprj, Remote.pont and Remote.pins files). "Road Traffic" example demonstrates technique of using  signal transmission. This techniques consist in asserting special facts - Signals - into the Working Memory of the Expert System by some scenarios or rules and consuming them by other scenarios or rules. Signals can be transmitted remotely using the Protege server technology.  This techniques demonstrates a "Remote Police Work" example.

    Running "Road Traffic" example

1. Start run_protege.sh (Linux, Mac OS X) or run_protege.bat (Windows).

2. Open the project Ground.pprj, go to the "Drools" Tab and compile ontology. This should be done only once for this project.

3. Create the RuleBase and evaluate "Create DroTimer from RuNA" and "Create Roads from Layer" scripts.(Sometimes creating RuleBase just after compiling you can get an error message. In that case close the project and restart Protege. Don't recompile ontology but go  straight to create Rule Base).

4. During evaluation of the second script you will be asked to select a map layer from wich roads would be created. Select the "Major Roads". Answer "No" to a question asking you to assert roads to the Workin Memory.

5. Assert an instance "Viborg Traffic".

6. Go to the "OpenMap" tab, start timer and set time scale to 32:1. Soon you will see how vehicles are mooving along the roads according to the timetable. You can make movement more smooth by setting the "Seconds on Timer Ticks" to, for example 0.1 or less for powerful machines (stop timer previously).

7. Approximately after one hour (don't be afraid, with 32:1 time scale this is only 2 minutes :) ) vehicles begin to collide with a probability of 0.3 (this probability value defined in the Rule instance "RTA.Targets Monitor"). Collision locations would be marked with a yellow star marker.

    Running "Remote Police Work" example

1. Start Protege and open a project <DroolsTabScene-Home>/netcom/metaproject.pprj. Go to the "Instances" Tab and open a "NetCom" instance of the class "Project" (subclass of "PolicyControlledObject"). Edit a "Location" slot content to full path to a "NetCom" project. Do'nt forget to save the "metaproject" project.
    Examples:
       "C:/DroolsTabScene-5.1/netcom/NetCom.pprj"                   -- Windows
       "/home/ru/DroolsTabScene-5.1/netcom/NetCom.pprj"        -- Linux
       "/Applications/DroolsTabScene-5.1/netcom/NetCom.pprj"   -- Mac OS X

2. Edit run_protege_server.sh (run_protege_server.bat) file in the Protege home folder such that METAPROJECT variable would point to <DroolsTabScene-Home>/netcom/metaproject.pprj
    Examples:
       METAPROJECT=/Applications/DroolsTabScene-5.1/netcom/metaproject.pprj     # Mac OS X
       METAPROJECT=/home/ru/DroolsTabScene-5.1/netcom/metaproject.pprj            # Linux
       METAPROJECT=c:/DroolsTabScene-5.1/netcom/metaproject.pprj                       rem Windows

3. Run this file. This starts Protege server that will be transmitting signals between the "Ground" project and the "Remote" project.

4. Start <DroolsTabScene-Home>/run_protege.sh (Linux, Mac OS X) or <DroolsTabScene-Home>/run_protege.bat (Windows) once more and open the project Remote.pprj

5. Create RuleBase and evaluate "Create DroTimer from RuNA" and "Receive Remote Signals" scripts.

6. Go to the "OpenMap" Tab and start timer. Set time scale to 32:1.

7. Start a "P.Police Work" scenario. Now every time when a collision happens in the "Ground" project a signal would be sent to the "Remote" project through the Protege server and the POLICE send a helicopter to the collision location.

8. You can run the Ground, Remote and server projects all on different machines. To do so create in the Ground and Remote projects a new instance of the "NetCom" class and fill its "host" slot with an IP-address of the machine on which the Protege server would be running. Other slots fill the same. Don't forget to remove a yellow stiker from the "Local Net Communication" instance on the new one (delete on the old and create on the new), because annotated (marked with the stiker) instance is used for configuration client-server connection.

If something goes wrong send me Java console output and the problem description.

    Ru (mailto:sorokin@oogis.ru)