Search in sources :

Example 1 with FunctionPlotterCtrl

use of aima.gui.fx.views.FunctionPlotterCtrl in project aima-java by aimacode.

the class GeneticMaximumFinderApp method createRootPane.

/**
	 * Defines state view, parameters, and call-back functions and calls the
	 * simulation pane builder to create layout and controller objects.
	 */
@Override
public Pane createRootPane() {
    BorderPane root = new BorderPane();
    Canvas canvas = new Canvas();
    funcPlotterCtrl = new FunctionPlotterCtrl(canvas);
    funcPlotterCtrl.setLimits(Functions.minX, Functions.maxX, Functions.minY, Functions.maxY);
    List<Parameter> params = createParameters();
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(canvas);
    builder.defineInitMethod(this::initialize);
    builder.defineSimMethod(this::simulate);
    simPaneCtrl = builder.getResultFor(root);
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) Canvas(javafx.scene.canvas.Canvas) Parameter(aima.gui.fx.framework.Parameter) FunctionPlotterCtrl(aima.gui.fx.views.FunctionPlotterCtrl)

Example 2 with FunctionPlotterCtrl

use of aima.gui.fx.views.FunctionPlotterCtrl in project aima-java by aimacode.

the class SimulatedAnnealingMaximumFinderApp method createRootPane.

/**
	 * Defines state view, parameters, and call-back functions and calls the
	 * simulation pane builder to create layout and controller objects.
	 */
@Override
public Pane createRootPane() {
    BorderPane root = new BorderPane();
    Canvas canvas = new Canvas();
    funcPlotterCtrl = new FunctionPlotterCtrl(canvas);
    funcPlotterCtrl.setLimits(Functions.minX, Functions.maxX, Functions.minY, Functions.maxY);
    List<Parameter> params = createParameters();
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(canvas);
    builder.defineInitMethod(this::initialize);
    builder.defineSimMethod(this::simulate);
    simPaneCtrl = builder.getResultFor(root);
    simPaneCtrl.setParam(SimulationPaneCtrl.PARAM_SIM_SPEED, 1);
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) Canvas(javafx.scene.canvas.Canvas) Parameter(aima.gui.fx.framework.Parameter) FunctionPlotterCtrl(aima.gui.fx.views.FunctionPlotterCtrl)

Aggregations

Parameter (aima.gui.fx.framework.Parameter)2 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)2 FunctionPlotterCtrl (aima.gui.fx.views.FunctionPlotterCtrl)2 Canvas (javafx.scene.canvas.Canvas)2 BorderPane (javafx.scene.layout.BorderPane)2