Class TradeRouteMapper
java.lang.Object
org.episteme.social.history.TradeRouteMapper
Maps and models historical trade routes, connecting distant trading posts.
Provides tools for distance calculation, travel time estimation, and network centrality analysis.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSpecific segment between two consecutive trading posts in a route.static final recordRepresents an established trade route consisting of multiple waypoints.static final recordRepresents a historical trading hub with its geographical location and primary goods. -
Method Summary
Modifier and TypeMethodDescriptionCalculates the network centrality of trading posts based on route connectivity.static RealCalculates the total distance of a trade route in kilometers using haversine formula.static intEstimates the number of travel days for a route based on transport mode.static List<TradeRouteMapper.TradingPost> findByGoods(String commodity) Searches for trading posts associated with a specific commodity.static List<TradeRouteMapper.TradeRoute> getActiveRoutes(int year) Retrieves all recorded routes that were active in a specific year.static voidInitializes the database with major historical trade routes.
-
Method Details
-
loadHistoricalData
public static void loadHistoricalData()Initializes the database with major historical trade routes. -
getActiveRoutes
Retrieves all recorded routes that were active in a specific year.- Parameters:
year- historical year- Returns:
- unmodifiable list of active trade routes
-
calculateRouteDistance
Calculates the total distance of a trade route in kilometers using haversine formula.- Parameters:
route- the trade route- Returns:
- total distance as a
Realnumber - Throws:
NullPointerException- if route is null
-
estimateTravelDays
Estimates the number of travel days for a route based on transport mode.- Parameters:
route- the trade route- Returns:
- estimated duration in days
- Throws:
NullPointerException- if route is null
-
findByGoods
Searches for trading posts associated with a specific commodity.- Parameters:
commodity- commodity name- Returns:
- unmodifiable list of trading posts dealing in that commodity
- Throws:
NullPointerException- if commodity is null
-
calculateCentrality
-