use of aima.core.util.math.geom.SVGGroupParser in project aima-java by aimacode.
the class SVGGroupParserTest method setUp.
@Before
public void setUp() {
testGroup = new ArrayList<IGeometric2D>();
testGroup.ensureCapacity(10);
testGroup.add(new Polyline2D(testVertices1, true));
testGroup.add(new Line2D(15.0d, 15.0d, 200.0d, 100.0d));
testGroup.add(new Ellipse2D(new Point2D(300.0d, 80.0d), 60.0d, 40.0d));
testGroup.add(new Circle2D(new Point2D(180.0d, 160.0d), 20.0d));
testGroup.add(new Rect2D(161.0d, 200.0d, 261.0d, 250.0d));
testGroup.add(new Polyline2D(testVertices2, true));
testGroup.add(new Line2D(0.0d, 0.0d, 700.0d, 0.0d));
testGroup.add(new Line2D(700.0d, 0.0d, 700.0d, 500.0d));
testGroup.add(new Line2D(700.0d, 500.0d, 0.0d, 500.0d));
testGroup.add(new Line2D(0.0d, 500.0d, 0.0d, 0.0d));
testParser = new SVGGroupParser();
}
use of aima.core.util.math.geom.SVGGroupParser in project aima-java by aimacode.
the class MonteCarloLocalizationApp method initialize.
/**
* Creates a {@link GenericMonteCarloLocalization2DApp} and stores it in {@code app}.<br/>
* In addition the corresponding {@link IRobotGui} is created and stored in {@code robotGui}. The function {@code robotGui.destructRobot()} will be called when the application window closes to allow closing any open connections gracefully.
*/
protected void initialize() {
SimpleSettingsListener settingsListener = new SimpleSettingsListener(settingsGui);
settingsListener.createSettings();
AnglePanel angles = new AnglePanel(RANGE_READING_ANGLES_TITLE);
settingsGui.registerSpecialSetting(RANGE_READING_ANGLES_KEY, angles);
MclCartesianPlot2D<SimplePose, SimpleMove, AbstractRangeReading> map = new MclCartesianPlot2D<SimplePose, SimpleMove, AbstractRangeReading>(new SVGGroupParser(), new SVGGroupParser(), new SimplePoseFactory(), new SimpleRangeReadingFactory());
VirtualRobot robot = new VirtualRobot(map);
robotGui = new VirtualRobotGui(robot);
MonteCarloLocalization<SimplePose, Angle, SimpleMove, AbstractRangeReading> mcl = new MonteCarloLocalization<SimplePose, Angle, SimpleMove, AbstractRangeReading>(map, new JavaRandomizer());
app = new GenericMonteCarloLocalization2DApp<SimplePose, SimpleMove, SimpleRangeReading>(mcl, map, robot, robotGui, settingsGui);
angles.setChangeListener((ChangeListener) robotGui);
settingsListener.setMap(map);
settingsListener.setMcl(mcl);
settingsListener.setRobot(robot);
}
Aggregations