Class SimulationExport
java.lang.Object
com.eco.bio7.simulation.SimulationExport
Exports a simulation model of the simulation API (a Java source file of a
subclass of
GridModel or AgentModel) as an interactive HTML
page: the model is translated to JavaScript (JavaToJs), runs with the
JavaScript version of the API and is displayed with the page of
HtmlSimulation (a 2D grid or a 3D view, the settings of the Param
fields, Play/Pause, Step, Reset, the speed and a chart).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe options of the page.static classThe result of a translation: the page or the errors. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SimulationExport.Resultcreate(String source, String unitName, String[] classpath, SimulationExport.Options options) Translates the model and creates the page.static SimulationExport.Resultexport(String source, String unitName, String[] classpath, SimulationExport.Options options, String file) Translates the model and writes the page (throws an exception with the errors).
-
Field Details
-
RUNTIME
The JavaScript version of the simulation API (com.eco.bio7.simulation).- See Also:
-
-
Constructor Details
-
SimulationExport
public SimulationExport()
-
-
Method Details
-
create
public static SimulationExport.Result create(String source, String unitName, String[] classpath, SimulationExport.Options options) Translates the model and creates the page.- Parameters:
source- the Java source of the modelunitName- the name of the file (e.g., "Life.java")classpath- the classpath with the API of Bio7options- the options of the page (null: defaults)
-
export
public static SimulationExport.Result export(String source, String unitName, String[] classpath, SimulationExport.Options options, String file) throws IOException Translates the model and writes the page (throws an exception with the errors).- Throws:
IOException
-