|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object smithers.extras.Lindenmayer
public class Lindenmayer
Implements Lindenmayer systems and displays output with turtle graphics.
Constructor Summary | |
---|---|
Lindenmayer(java.lang.String axiom,
java.util.Map<java.lang.String,java.lang.String> rules)
Creates a new Lindenmayer system. |
Method Summary | |
---|---|
static java.lang.String |
evolveToString(java.lang.String axiom,
java.util.Map<java.lang.String,java.lang.String> rules,
int steps)
Creates a Lindenmayer system, evolves it for a number of steps, and outputs as a string. |
static void |
evolveToTG(java.lang.String axiom,
java.util.Map<java.lang.String,java.lang.String> rules,
int steps,
double angle,
double distance,
double x,
double y,
double dir,
double width,
double height,
java.lang.String fileName)
Creates a Lindenmayer system, evolves it for a number of steps, and outputs using turtle graphics, saving as an SVG file. |
java.lang.String |
getState()
Gets the current state. |
static void |
main(java.lang.String[] args)
Tester. |
void |
nextStep()
Performs one step of the evolution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Lindenmayer(java.lang.String axiom, java.util.Map<java.lang.String,java.lang.String> rules)
axiom
- the initial staterules
- the replacement rulesMethod Detail |
---|
public java.lang.String getState()
public void nextStep()
public static java.lang.String evolveToString(java.lang.String axiom, java.util.Map<java.lang.String,java.lang.String> rules, int steps)
axiom
- the initial state of the systemrules
- the rules for the systemsteps
- the number of steps to runpublic static void evolveToTG(java.lang.String axiom, java.util.Map<java.lang.String,java.lang.String> rules, int steps, double angle, double distance, double x, double y, double dir, double width, double height, java.lang.String fileName) throws java.io.IOException
axiom
- the initial state of the systemrules
- the rules for the systemsteps
- the number of steps to runangle
- the angle to turn bydistance
- the distance to movex
- the initial x-coordinatey
- the initial y-coordinatedir
- the initial directionwidth
- the width of the imageheight
- the height of the imagefileName
- the filename to save under
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
args
- the arguments
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |