Public Member Functions

Lsystem Class Reference

Structure of the L-system, which consists of an alphabet of symbols, a collection of production rules and an initial axiom from which to begin the construction. More...

#include <Lsystem.hpp>

Collaboration diagram for Lsystem:
Collaboration graph
[legend]

Public Member Functions

 Lsystem ()
 Plain L-system constructor.
 Lsystem (const set< char > &vars, const string start, const multimap< char, string > &rules)
 Parametric L-system constructor.
string produce (const int numIter) const
 Generate a production by iterating the system on the initial axiom.

Detailed Description

Structure of the L-system, which consists of an alphabet of symbols, a collection of production rules and an initial axiom from which to begin the construction.

The constants are implicitly defined by those symbols in the alphabet that are not expanded by any production rule.

In case more than one production rule is available for a given symbol, i.e., a stochastic grammar, a choice is taken according to an uniform probability distribution among the possible rules.

Author:
Alexandre Trilla (atrilla)

Definition at line 59 of file Lsystem.hpp.


Constructor & Destructor Documentation

Lsystem::Lsystem (  ) 

Plain L-system constructor.

Postcondition:
Initialises an undefined L-system (null parameters). This is useless. Use the parametric constructor instead.
Lsystem::Lsystem ( const set< char > &  vars,
const string  start,
const multimap< char, string > &  rules 
)

Parametric L-system constructor.

Parameters:
vars The variables.
start The initial axiom.
rules The production rules.
Precondition:
The L-system definition must be consistent.
Postcondition:
Initialises the defined L-system.

Member Function Documentation

string Lsystem::produce ( const int  numIter  )  const

Generate a production by iterating the system on the initial axiom.

A stochastic L-system is allowed.

Parameters:
numIter The number of iterations to run.
Returns:
Sequence of symbols by the end of the iteration.
Precondition:
The parametric L-system must be defined.
Postcondition:
Produces a sequence of symbols by iteration.

The documentation for this class was generated from the following file: