All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sim.app.lsystem.LSystemData Maven / Gradle / Ivy

Go to download

MASON is a fast discrete-event multiagent simulation library core in Java, designed to be the foundation for large custom-purpose Java simulations, and also to provide more than enough functionality for many lightweight simulation needs. MASON contains both a model library and an optional suite of visualization tools in 2D and 3D.

The newest version!
/*
  Copyright 2006 by Daniel Kuebrich
  Licensed under the Academic Free License version 3.0
  See the file "LICENSE" for more information
*/

// Class LSystemData
package sim.app.lsystem;
import java.util.*;

// This class holds the L-system data.
// It is set in RuleUI's calculation thread, and
// in DrawUI's Set button call, then copied into
// a LSystemDrawer instance (on LSystem.start()).  The LSystemDrawer is
// a steppable which draws the L-system post-calculation.
// So, this class holds the data between the time of 
// calculation and draw setting and the actual drawing.

public  class LSystemData implements java.io.Serializable
    {
    // Use exactly this serialVersionUID: the various lss files were serialized under it
    private static final long serialVersionUID = 2491061639713100804L;

    // expanded code and rule lists
    public ByteList code;
    public ArrayList rules;
    
    // used only for deserialization
    public String seed;
    public int expansions;
    
    // for drawing--basically just passed to LSystemDrawer
    // start facing upward
    public double theta=-/*Strict*/Math.PI/2;
    // length of segment
    public double segsize = 2;
    // rotation angle
    public double angle = /*Strict*/Math.PI/2;
    // start coordinates
    public double x=50,y=50;
    
    // turns a string of chars into a ByteList
    public static void setVector( ByteList v, final String dat )
        {
        v.clear();
        int p = 0;
        for(p=0; p




© 2015 - 2025 Weber Informatics LLC | Privacy Policy