|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.person.ai.mission.TradeUtil
public final class TradeUtil
Utility class for static trade methods.
Method Summary | |
---|---|
static java.util.Map<Good,java.lang.Integer> |
determineLoad(Settlement buyingSettlement,
Settlement sellingSettlement,
Rover rover,
double valueLimit)
Determines the load between a buying settlement and a selling settlement. |
static double |
determineLoadValue(java.util.Map<Good,java.lang.Integer> load,
Settlement settlement,
boolean buy)
Determines the value of a load to a settlement. |
static double |
getEstimatedMissionCost(Settlement startingSettlement,
Rover rover,
double distance)
Gets the estimated trade mission cost. |
static double |
getNumInInventory(Good good,
Inventory inventory)
Gets the number of a good currently in the inventory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.Map<Good,java.lang.Integer> determineLoad(Settlement buyingSettlement, Settlement sellingSettlement, Rover rover, double valueLimit) throws java.lang.Exception
buyingSettlement
- the settlement buying the goods.sellingSettlement
- the settlement selling the goods.rover
- the rover to carry the goods.valueLimit
- the value limit for determining the load.
java.lang.Exception
- if error determining the load.public static double determineLoadValue(java.util.Map<Good,java.lang.Integer> load, Settlement settlement, boolean buy) throws java.lang.Exception
load
- a map of the goods and their number.settlement
- the settlement valuing the load.buy
- true if settlement is buying the load, false if selling.
java.lang.Exception
- if error determining the load value.public static double getNumInInventory(Good good, Inventory inventory) throws java.lang.Exception
good
- the good to check.inventory
- the inventory to check.
java.lang.Exception
- if error getting number of goods in inventory.public static double getEstimatedMissionCost(Settlement startingSettlement, Rover rover, double distance) throws java.lang.Exception
startingSettlement
- the settlement starting the trade mission.rover
- the mission rover.distance
- the distance (km) of the mission trip.
java.lang.Exception
- if error getting the estimated mission cost.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |