Skip to content

Commit 070fd89

Browse files
committed
Some application class names changed.
1 parent 3104452 commit 070fd89

File tree

17 files changed

+42
-46
lines changed

17 files changed

+42
-46
lines changed

aima-core/src/main/java/aima/core/environment/map/MapAgent.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ protected Optional<Object> formulateGoal() {
9797
((Informed<String, MoveToAction>) search).setHeuristicFunction(hFnFactory.apply(goal));
9898

9999
if (notifier != null)
100-
notifier.notifyViews("CurrentLocation=In(" + state.getAttribute(DynAttributeNames.AGENT_LOCATION)
101-
+ "), Goal=In(" + goal + ")");
100+
notifier.notifyViews("Current location: In(" + state.getAttribute(DynAttributeNames.AGENT_LOCATION)
101+
+ "), Goal: In(" + goal + ")");
102102
}
103103
return goal != null ? Optional.of(goal) : Optional.empty();
104104
}
@@ -117,11 +117,7 @@ protected Optional<List<MoveToAction>> search(Problem<String, MoveToAction> prob
117117
}
118118

119119
protected void notifyViewOfMetrics() {
120-
if (notifier != null) {
121-
Set<String> keys = search.getMetrics().keySet();
122-
for (String key : keys) {
123-
notifier.notifyViews("METRIC[" + key + "]=" + search.getMetrics().get(key));
124-
}
125-
}
120+
if (notifier != null)
121+
notifier.notifyViews("Search metrics: " + search.getMetrics());
126122
}
127123
}
-80.5 KB
Loading

aimax-osm/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ This project provides a framework for building intelligent Open Street Map
1111
and search concepts from the AIMA library in a non-trivial
1212
application area and provide an interesting coding environment for student
1313
projects. Typical programming challenges include:
14-
* Extend the `OsmRoutePlannerApp` and provide additional options, e.g. to optimize
14+
* Extend the `RoutePlannerOsmApp` and provide additional options, e.g. to optimize
1515
time for a driver, to optimize fun for a cyclist, ...
16-
* Extend the `OsmLRTAStarAgentApp` and add variants of the original LRTAStar-based
16+
* Extend the `OnlineAgentOsmApp` and add variants of the original LRTAStar-based
1717
agent which try to perform better than the original in this special environment, e.g.
1818
by increasing greediness.
19-
* Extend the `OsmAgentBaseApp` and add a new agent which is able to react on unforeseen
19+
* Extend the `RouteFindingAgentOsmApp` and add a new agent which is able to react on unforeseen
2020
events, e.g. on a road blocking defined by additional markers.
2121
* Develop an agent which plans the Saturday morning shopping tour for you. Try to
2222
create an optimal tour (the typical greedy TSP implementation is not that challenging...).

aimax-osm/src/main/java/aimax/osm/data/DataResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Ruediger Lunde
88
*/
99
public class DataResource {
10-
public static InputStream getULMFileResource() {
10+
public static InputStream getUlmFileResource() {
1111
return DataResource.class.getResourceAsStream("ulm.osm");
1212
}
1313
}

aimax-osm/src/main/java/aimax/osm/gui/fx/IntegratedAimaOsmFxApp.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import aima.gui.fx.applications.IntegratedAimaFxApp;
44
import aima.gui.fx.framework.IntegratedAppBuilder;
5-
import aimax.osm.gui.fx.applications.OsmOnlineAgentApp;
6-
import aimax.osm.gui.fx.applications.OsmRouteFindingAgentApp;
7-
import aimax.osm.gui.fx.applications.OsmRoutePlannerApp;
8-
import aimax.osm.gui.fx.applications.OsmAgentBaseApp;
5+
import aimax.osm.gui.fx.applications.OnlineAgentOsmApp;
6+
import aimax.osm.gui.fx.applications.ExtendedRouteFindingAgentOsmApp;
7+
import aimax.osm.gui.fx.applications.RoutePlannerOsmApp;
8+
import aimax.osm.gui.fx.applications.RouteFindingAgentOsmApp;
99
import javafx.application.Application;
1010
import javafx.stage.Stage;
1111

@@ -35,9 +35,9 @@ public void start(Stage primaryStage) throws Exception {
3535
public static void defineContent(IntegratedAppBuilder builder) {
3636
IntegratedAimaFxApp.defineContent(builder);
3737

38-
builder.registerApp(OsmRoutePlannerApp.class);
39-
builder.registerApp(OsmAgentBaseApp.class);
40-
builder.registerApp(OsmRouteFindingAgentApp.class);
41-
builder.registerApp(OsmOnlineAgentApp.class);
38+
builder.registerApp(RoutePlannerOsmApp.class);
39+
builder.registerApp(RouteFindingAgentOsmApp.class);
40+
builder.registerApp(ExtendedRouteFindingAgentOsmApp.class);
41+
builder.registerApp(OnlineAgentOsmApp.class);
4242
}
4343
}

aimax-osm/src/main/java/aimax/osm/gui/fx/applications/OsmRouteFindingAgentApp.java renamed to aimax-osm/src/main/java/aimax/osm/gui/fx/applications/ExtendedRouteFindingAgentOsmApp.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
/**
2727
* Integrable application which demonstrates how different kinds of search
2828
* algorithms perform in a route finding scenario based on a real OSM map. This
29-
* implementation extends <code>OsmAgentBaseApp</code> by two aspects: Map
29+
* implementation extends {@link RouteFindingAgentOsmApp} by two aspects: Map
3030
* locations corresponding to expanded nodes are highlighted in green. The user
3131
* can define several goals by placing more then two markers on the map.
3232
*
3333
* @author Ruediger Lunde
3434
*
3535
*/
36-
public class OsmRouteFindingAgentApp extends OsmAgentBaseApp {
36+
public class ExtendedRouteFindingAgentOsmApp extends RouteFindingAgentOsmApp {
3737

3838
public static void main(String[] args) {
3939
launch(args);
@@ -47,7 +47,7 @@ public static void main(String[] args) {
4747

4848
@Override
4949
public String getTitle() {
50-
return "OSM Route Finding Agent App";
50+
return "Extended Route Finding Agent OSM App";
5151
}
5252

5353
/**
@@ -99,8 +99,8 @@ protected Agent createAgent(List<String> locations) {
9999
// helper classes...
100100

101101
/**
102-
* Variant of the <code>DefaultMapEntityRenderer</code> which highlights way
103-
* nodes mentioned in {@link SearchDemoOsmAgentApp#visitedStates}.
102+
* Variant of the {@link DefaultEntityRenderer} which highlights way
103+
* nodes mentioned in {@link ExtendedRouteFindingAgentOsmApp#visitedStates}.
104104
*/
105105
private static class SDMapEntityRenderer extends DefaultEntityRenderer {
106106
DefaultEntityViewInfo highlightProp = new MapStyleFactory().createPoiInfo(0, 0, 5, UColor.GREEN,

aimax-osm/src/main/java/aimax/osm/gui/fx/applications/OsmViewerApp.java renamed to aimax-osm/src/main/java/aimax/osm/gui/fx/applications/InteractiveMapViewerOsmApp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @author Ruediger Lunde
1919
*/
20-
public class OsmViewerApp extends Application {
20+
public class InteractiveMapViewerOsmApp extends Application {
2121
public static void main(String[] args) {
2222
launch(args);
2323
}
@@ -32,13 +32,13 @@ public void start(Stage primaryStage) throws Exception {
3232

3333
StackPane mapPane = new StackPane();
3434
MapPaneCtrl mapPaneCtrl = new MapPaneCtrl(mapPane);
35-
mapPaneCtrl.loadMap(DataResource.getULMFileResource());
35+
mapPaneCtrl.loadMap(DataResource.getUlmFileResource());
3636

3737
BorderPane root = new BorderPane();
3838
root.setCenter(mapPane);
3939
Scene scene = new Scene(root, 800, 600);
4040

41-
primaryStage.setTitle("Osm Viewer App");
41+
primaryStage.setTitle("Interactive Map Viewer OSM App");
4242
primaryStage.setScene(scene);
4343
primaryStage.show();
4444
}

aimax-osm/src/main/java/aimax/osm/gui/fx/applications/OsmOnlineAgentApp.java renamed to aimax-osm/src/main/java/aimax/osm/gui/fx/applications/OnlineAgentOsmApp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* @author Ruediger Lunde
4242
*
4343
*/
44-
public class OsmOnlineAgentApp extends IntegrableApplication {
44+
public class OnlineAgentOsmApp extends IntegrableApplication {
4545

4646
public static String PARAM_STRATEGY = "strategy";
4747

@@ -61,12 +61,12 @@ public static void main(String[] args) {
6161

6262
@Override
6363
public String getTitle() {
64-
return "OSM Online Agent App";
64+
return "Online Agent OSM App";
6565
}
6666

6767
/** Loads a map of the city of Ulm, Germany. Override to change the map. */
6868
protected void loadMap() {
69-
mapPaneCtrl.loadMap(DataResource.getULMFileResource());
69+
mapPaneCtrl.loadMap(DataResource.getUlmFileResource());
7070
}
7171

7272
protected List<Parameter> createParameters() {

aimax-osm/src/main/java/aimax/osm/gui/fx/applications/OsmAgentBaseApp.java renamed to aimax-osm/src/main/java/aimax/osm/gui/fx/applications/RouteFindingAgentOsmApp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* @author Ruediger Lunde
4242
*
4343
*/
44-
public class OsmAgentBaseApp extends IntegrableApplication {
44+
public class RouteFindingAgentOsmApp extends IntegrableApplication {
4545

4646
public static void main(String[] args) {
4747
launch(args);
@@ -62,12 +62,12 @@ public static void main(String[] args) {
6262

6363
@Override
6464
public String getTitle() {
65-
return "OSM Agent Base App";
65+
return "Route Finding Agent OSM App";
6666
}
6767

6868
/** Loads a map of the city of Ulm, Germany. Override to change the map. */
6969
protected void loadMap() {
70-
mapPaneCtrl.loadMap(DataResource.getULMFileResource());
70+
mapPaneCtrl.loadMap(DataResource.getUlmFileResource());
7171
}
7272

7373
/** Defines the parameters to be shown in the simulation pane tool bar. */

aimax-osm/src/main/java/aimax/osm/gui/fx/applications/OsmRoutePlannerApp.java renamed to aimax-osm/src/main/java/aimax/osm/gui/fx/applications/RoutePlannerOsmApp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author Ruediger Lunde
2525
*/
26-
public class OsmRoutePlannerApp extends IntegrableApplication {
26+
public class RoutePlannerOsmApp extends IntegrableApplication {
2727

2828
public static void main(String[] args) {
2929
launch(args);
@@ -69,7 +69,7 @@ public Pane createRootPane() {
6969
StackPane mapPane = new StackPane();
7070
mapPaneCtrl = new MapPaneCtrl(mapPane);
7171
mapPaneCtrl.getMap().addMapDataEventListener(ev -> updateEnabledState());
72-
mapPaneCtrl.loadMap(DataResource.getULMFileResource());
72+
mapPaneCtrl.loadMap(DataResource.getUlmFileResource());
7373

7474
root.setCenter(mapPane);
7575

0 commit comments

Comments
 (0)