Simbad and Python

Home | Download | Docs | Screenshots | SourceForge Summary

Python scripting examples

It is easy to program Simbad with Java and it is even easier to program it with Python. As you probably know, Python is a very powerful language particularly suited for Artificial Intelligence and Computer Science experiments in general. To execute Python scripts with simbad you need the famous Jython package. Jython is a Python interpreter written in Java, it adds Python scripting facilities to the java language and permit to script directly Simbad classes.

Launching scripts

Jython can be downloaded from Follow Jython (easy) install procedure then edit scripts and launch them with: jython

For this to work simbad.jar must be on your CLASSPATH

Note: Python scripting is only available since Simbad 1.3.1 version.

A Simple controler

from simbad.gui import *
from simbad.sim import *
from  javax.vecmath import *

# a very simple robot controller , derived from Agent java class.
class MyRobot(Agent):
	def initBehavior(self):
		# nothing to do
	def performBehavior(self):
		if self.collisionDetected():

# description of the environment 
class MyEnv(EnvironmentDescription):
	def __init__(self):
		# put a  robot 
		self.add(MyRobot(Vector3d(0,0,0),"robot with python"))
		# put a box 
		self.add(Box(Vector3d(3, 0, 0), Vector3f(1, 1, 1),self))

# launch simbad 
simbad = Simbad(MyEnv(),0)

Python scripts examples:

  • :this example shows the use of a simple plan in Python.
Simbad Project is hosted at Logo