Search in sources :

Example 6 with Parameter

use of aima.gui.fx.framework.Parameter 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 7 with Parameter

use of aima.gui.fx.framework.Parameter in project aima-java by aimacode.

the class NQueensCspApp 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();
    StackPane stateView = new StackPane();
    stateViewCtrl = new NQueensViewCtrl(stateView);
    List<Parameter> params = createParameters();
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(stateView);
    builder.defineInitMethod(this::initialize);
    builder.defineSimMethod(this::simulate);
    simPaneCtrl = builder.getResultFor(root);
    simPaneCtrl.setParam(SimulationPaneCtrl.PARAM_SIM_SPEED, 0);
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) NQueensViewCtrl(aima.gui.fx.views.NQueensViewCtrl) Parameter(aima.gui.fx.framework.Parameter) StackPane(javafx.scene.layout.StackPane)

Example 8 with Parameter

use of aima.gui.fx.framework.Parameter in project aima-java by aimacode.

the class NQueensSearchApp method createParameters.

protected List<Parameter> createParameters() {
    Parameter p1 = new Parameter(PARAM_STRATEGY, "Depth-First Search (incremental)", "Breadth-First Search (incremental)", "Iterative Deepening Search", "Greedy Best-First Search (attacking pair heuristic)", "A* search (attacking pair heuristic)", "Hill Climbing", "Simulated Annealing", "Genetic Algorithm");
    Parameter p2 = new Parameter(PARAM_BOARD_SIZE, 4, 8, 16, 32, 64);
    p2.setDefaultValueIndex(1);
    Parameter p3 = new Parameter(PARAM_INIT_CONFIG, "FirstRow", "Random");
    p3.setDependency(PARAM_STRATEGY, "Iterative Deepening Search", "Greedy Best-First Search (attacking pair heuristic)", "A* search (attacking pair heuristic)", "Hill Climbing", "Simulated Annealing", "Genetic Algorithm");
    return Arrays.asList(p1, p2, p3);
}
Also used : Parameter(aima.gui.fx.framework.Parameter)

Example 9 with Parameter

use of aima.gui.fx.framework.Parameter 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)

Example 10 with Parameter

use of aima.gui.fx.framework.Parameter in project aima-java by aimacode.

the class OsmLRTAStarAgentApp 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();
    List<Parameter> params = createParameters();
    StackPane mapPane = new StackPane();
    mapPaneCtrl = new MapPaneCtrl(mapPane);
    loadMap();
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(mapPane);
    builder.defineInitMethod(this::initialize);
    builder.defineSimMethod(this::simulate);
    simPaneCtrl = builder.getResultFor(root);
    simPaneCtrl.setParam(SimulationPaneCtrl.PARAM_SIM_SPEED, 0);
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) MapPaneCtrl(aimax.osm.gui.fx.viewer.MapPaneCtrl) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) Parameter(aima.gui.fx.framework.Parameter) StackPane(javafx.scene.layout.StackPane)

Aggregations

Parameter (aima.gui.fx.framework.Parameter)20 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)10 BorderPane (javafx.scene.layout.BorderPane)10 StackPane (javafx.scene.layout.StackPane)8 FunctionPlotterCtrl (aima.gui.fx.views.FunctionPlotterCtrl)2 NQueensViewCtrl (aima.gui.fx.views.NQueensViewCtrl)2 MapPaneCtrl (aimax.osm.gui.fx.viewer.MapPaneCtrl)2 Canvas (javafx.scene.canvas.Canvas)2 EightPuzzleViewCtrl (aima.gui.fx.views.EightPuzzleViewCtrl)1 MapEnvironmentViewCtrl (aima.gui.fx.views.MapEnvironmentViewCtrl)1 SimpleEnvironmentViewCtrl (aima.gui.fx.views.SimpleEnvironmentViewCtrl)1 VacuumEnvironmentViewCtrl (aima.gui.fx.views.VacuumEnvironmentViewCtrl)1