NEAL Home Page
Middlesex Logo

Code and Short Tutorial for Rule-Based System

Introduction

Code

  1. Download the Rule-Based System (RBS) tarball from January 2020.
  2. Grab the tarball, unzip, and untar it.
  3. The directory you just got contains the RBS folder and three examples, Monkeys, Tower of Hanoi and Sudoku
  4. The rbs uses a neural Finite State Automata.
  5. Each folder has its own tests that run with both Nest and SpiNNaker.
  6. Before running examples, verify the correct functioning of the RBS following the instructions in the Tutorial section.

Tutorial

Get the rbs running

  1. The system runs with Ubuntu 14.04 and Ubuntu 16.04.
  2. Staying outside the rbs folder, type in the terminal sh rbs/runTests.sh to run all the rbs tests.
    The results are then printed in the file results.sp located in the folder rbs/tests/results/ .
    The file results.sp contains the outputs from the tests listed in the rbs/tests folder.
  3. If you don't receive errors, you can go ahead with the examples that use the rbs with both Nest and SpiNNaker.

Monkey Example

  1. The "Monkey and banana problem" is a classic toy problem in AI (click here for more info).
  2. Staying inside the monkeys folder, type in the terminal sh runNest.sh to obtain results for all the monkeys tests by using the Nest simulator.
    Instead, if you are using the SpiNNaker board, type sh runSpinn8.sh.
    The results are printed in the tests/results folder.
    Nest results are named with Nest_testName.sp and SpiNNaker results with Spinn8_testName.sp.
  3. You can run isolated test going in the test folder and selecting one of them.
    They are six:
    1) Monkey_SingleFruit.py,
    2) Monkey_SingleWithChair.py,
    3) Monkey_TwoFruits.py,
    4) Monkey_TwoPlaceFruits.py,
    5) Monkey_TwoSameFruits.py and
    6) Monkey_TwoSamePlaceFruits.py.
    Their fileName is always preceded by the prefix Nest or Spinn8 depending upon the chosen simulator.
  4. For example, if you are using Nest simulator, go in the test folder and type in terminal python Nest_Monkey_SingleFruit.py, and you will see printing the results directly on the terminal.
    If you want to save them in a file named spikes.txt, type python Nest_Monkey_SingleFruit.py > spikes.txt.

Tower of Hanoi Example

  1. The "Tower of Hanoi" is a classic test in cognitive psychology to probe human problem solving capacities (click here for more info).
  2. Staying inside the tower-of-hanoi folder, type in the terminal sh runNest.sh to obtain results for all the tests by using the Nest simulator.
    Instead, if you are using the SpiNNaker board, type sh runSpinn8.sh.
    The results are printed in the tests/results folder.
    Nest results are named with Nest_testName.sp and SpiNNaker results with Spinn8_testName.sp.
  3. You can run an isolated test in the test folder and selecting one of them.
    There are three:
    1) ToH3,
    2) ToH4 and
    3) ToH5.
    Their fileName is always preceded by the prefix Nest or Spinn8 depending upon the chosen simulator.
  4. For example, if you are using Nest simulator, within the test folder type in terminal python Nest_ToH3.py, and you will see printing the results directly on the terminal.
    If you want to save them in a file named spikes.txt, type python Nest_ToH3.py > spikes.txt.

Sudoku Example

  1. Sudoku is a mathematical game involving logic, combinatorics and numerical skills(click here for more info).
  2. Staying inside the sudoku folder, type in the terminal sh run6x6TestsNest.sh to obtain the results with the 6x6 cells game by using the Nest simulator.
    Instead, if you are using the SpiNNaker board, type sh run6x6TestsSpinn8.sh.
    The results are printed in the tests/results folder.
    Nest results are named with Nest_testName.sp and SpiNNaker results with Spinn8_testName.sp.
  3. You can run isolated test going in the test folder and selecting the
    1) Sudoku6_Test.py or
    2) Sudoku9_Test.py
    Their fileName is always preceded by the prefix Nest or Spinn8 depending upon the chosen simulator.
  4. For example, if you are using Nest simulator, within the test folder type in terminal python Nest_Sudoku6_Test.py, and you will see printing the results directly on the terminal.
    If you want to save them in a file named spikes.txt, type python Nest_Sudoku6x6.py > spikes.txt.