File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/aima/gui/applications/search/map Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11package aima .gui .applications .search .map ;
22
3+ import java .text .DecimalFormat ;
34import java .util .List ;
45
56import aima .basic .Agent ;
@@ -75,8 +76,10 @@ public void runAgent() {
7576 statusMsg .append ("Agent status: " + status );
7677 else
7778 statusMsg .append ("Task completed" );
78- if (travelDistance != null )
79- statusMsg .append ("; travel distance: " + travelDistance );
79+ if (travelDistance != null ) {
80+ DecimalFormat f = new DecimalFormat ("#0.0" );
81+ statusMsg .append ("; travel distance: " + f .format (travelDistance ));
82+ }
8083 statusMsg .append ("." );
8184 frame .setStatus (statusMsg .toString ());
8285 }
Original file line number Diff line number Diff line change 2020 * Demo example of a route planning agent application with GUI. The main method
2121 * starts a map agent frame and supports runtime experiments. This
2222 * implementation is based on the {@link aima.search.map.MapAgent} and the
23- * {@link aima.search.map.MapEnvironment} from the aima library . It can be used
23+ * {@link aima.search.map.MapEnvironment}. It can be used
2424 * as a code template for creating new applications with different specialized
2525 * kinds of agents and environments.
2626 *
You can’t perform that action at this time.
0 commit comments