X hits on this document

56 views

0 shares

0 downloads

0 comments

16 / 30

models that can be done with Repast), what it does it does well. Scripts can be separately loaded, in a proprietary scripting language, steve, or much better, using Python (though only v2.3 at present). Scripting environment limited compared to other Python IDEs, but it is efficient in loading.

Breve has some limitations. As mentioned, it is only suitable for 3D modeling. It also has certain magic methods, init() and iterate() that must be called to initialize agents and perform actions. Unlike Repast, you cannot set variable steps to do actions, they always happen each time. To get around computational issues, there is a separate post-iterate() method.

import breve

class HelloWorld( breve.Control ):

def

__

init

__( self ):

breve.Control.

__

init

__( self )

def iterate( self ):

print '''Hello, world!'''

breve.Control.iterate( self )

breve.HelloWorld = HelloWorld

  • #

    Create an instance of our controller object to initialize the simulation

HelloWorld()

Figure 7: Basic breve controller/agent model structure using Python

@include "Control.tz"

Controller HelloWorld.

Control : HelloWorld {

  • +

    to iterate:

print "Hello, world!".

super iterate.

}

Figure 8: Basic breve controller/agent model structure using steve

Document info
Document views56
Page views56
Page last viewedSun Dec 04 02:14:20 UTC 2016
Pages30
Paragraphs495
Words6732

Comments