PyANGConsole.ANGConsole

class ANGConsole

A class to load, save and close a network when using the Aimsun Console or the Aimsun Server.

Details

The following example shows how to load a network using the ANGConsole :

from PyANGKernel import *
from PyANGConsole import *
import sys

def main( argv ):
        if len(argv) < 3:
                print "usage: %s ANG_FILE_NAME MATRIX_ID" % argv[0]
                return -1

        # Start a Console
        console = ANGConsole()
        # Load a network
        if console.open( argv[1] ):
                matrix = console.getModel().getCatalog().find( int( argv[2] ) )
                if matrix != None :
                        ...
                        ...
                # Close the network
                console.close()
        else:
                console.getLog().addError( "Cannot load the network" )

if __name__ == "__main__":
        sys.exit(main( sys.argv ))

Inheritance diagram of PyANGConsole.ANGConsole

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

__init__()
__init__(argv)
Parameters:

argv – list of strings

close()

Closes the current model.

getLog()
Return type:

GKLog

The system look. Equivalent to:

GKSystem::getSystem().getLog()
getModel()
Return type:

GKModel

Returns the current model.

getVersion()
Return type:

str

Returns the version of the application, the revisio, OS and bits (32 or 64)

open(fileName)
Parameters:

fileName – str

Return type:

bool

Opens a file creating a new model, returns false if the file cannot be read.

save(fileName)
Parameters:

fileName – str

Return type:

bool

Saves the current model in a file, returns false if the file cannot be saved. The file, if exists, is overwritten.