/** @page libsbml-python-creating-model Tutorial: creating a simple model

The following is a short example of creating a complete model using the
libSBML Python interface.  This tutorial was kindly provided in 2012 by
Martins Mednis (<code>martins@mednis.info</code>, web page address <a
target="_blank"
href="http://mednis.info/wp/?p=3">http://mednis.info/wp/?p=3</a>).

We begin by importing the libSBML Python library and creating an empty SBML
document, using SBML Level&nbsp;2 Version&nbsp;4 for this example.

@verbatim
from libsbml import *
document = SBMLDocument()
model = document.createModel(2, 4) # SBML level and version
model.setName('My test model')
model.setId('MyModelID')
@endverbatim

Next, we create some compartments and set their volumes.

@verbatim
c1 = model.createCompartment()
c1.setName('Forest')
c1.setId('comp_FOREST')
c1.setVolume(1000)

c2 = model.createCompartment()
c2.setName('Meadow')
c2.setId('comp_Meadow')
c2.setVolume(1000)
@endverbatim

We continue apace, now creating species and setting their properties such as
their identifiers and initial amounts.

@verbatim
s1 = model.createSpecies()
s1.setName('Foxes')
s1.setId('spec_FOXES')
s1.setCompartment('comp_FOREST')
s1.setInitialAmount(10)

s2 = model.createSpecies()
s2.setName('Rabbits')
s2.setId('spec_RABBITS')
s2.setCompartment('comp_FOREST')
s2.setInitialAmount(50)

s3 = model.createSpecies()
s3.setName('Snakes')
s3.setId('spec_Snakes')
s3.setCompartment('comp_Meadow')
s3.setInitialAmount(100)
@endverbatim

Next, reactions.  For this example, we will create only one reaction.

@verbatim
r1 = model.createReaction()
r1.setName('Foxes eat rabbits')
r1.setId('R1')

# Create reactants and products.
reac1 = r1.createReactant()
reac1.setSpecies('spec_RABBITS')
prod1 = r1.createProduct()
prod1.setSpecies('spec_FOXES')

# Set stoichiometries.
reac1.setStoichiometry(2) # 2 rabbits
prod1.setStoichiometry(1) # 1 fox
@endverbatim

Finally, we add the model to the SBML document object and write the whole
thing to a file.

@verbatim
document.setModel(model)

# Save to a file.
writeSBMLToFile(document, 'name_of_your_model.xml')
@endverbatim


This tutorial has demonstrated one approach to creating models and their
components; the libSBML API actually provides other means of accomplishing
these goals, but for the purposes of this tutorial we focused only on one.
Readers are invited to explore the rest of this API manual as well as the
@ref libsbml-python-example-files "set of Python example files" included with
the libSBML distribution.


*/
