This webpage is for programmers who need examples of use of the functions of the module. The examples are designed to illustrate the syntax. They do not correspond to any meaningful model. For examples of models, visit biogeme.epfl.ch.
import datetime
print(datetime.datetime.now())
2021-08-04 16:38:43.667581
import biogeme.version as ver
print(ver.getText())
biogeme 3.2.8 [2021-08-04] Version entirely written in Python Home page: http://biogeme.epfl.ch Submit questions to https://groups.google.com/d/forum/biogeme Michel Bierlaire, Transport and Mobility Laboratory, Ecole Polytechnique Fédérale de Lausanne (EPFL)
import biogeme.filenames as fl
The role of this function is to obtain the name of a file that does not exist.
theName = fl.getNewFileName('test', 'dat')
theName
'test.dat'
Now, let's create that file, and call the function again. A suffix with a number is appended to the name of the file, before its extension.
open(theName, 'a').close()
theName = fl.getNewFileName('test', 'dat')
theName
'test~00.dat'
If we do it again, the number is incremented.
open(theName, 'a').close()
theName = fl.getNewFileName('test', 'dat')
theName
'test~01.dat'