From f6e44a3259e9dcb584f0953dbb8048c7db6b15cc Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 13 May 2019 21:54:21 +0100 Subject: [PATCH] Minor documentation fix --- docs/the-great-game.merchants.merchants.html | 24 +++++++++----------- src/the_great_game/merchants/merchants.clj | 16 ++++++------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/the-great-game.merchants.merchants.html b/docs/the-great-game.merchants.merchants.html index b3a4247..16035ab 100644 --- a/docs/the-great-game.merchants.merchants.html +++ b/docs/the-great-game.merchants.merchants.html @@ -1,17 +1,15 @@ the-great-game.merchants.merchants documentation

the-great-game.merchants.merchants

Trade planning for merchants, primarily.

augment-plan

(augment-plan merchant world plan)

Augment this plan constructed in this world for this merchant with the :quantity of goods which should be bought and the :expected-profit of the trade.

-

Returns the augmented plan.

burden

(burden merchant world)

The total weight of the current cargo carried by this merchant in this world.

expected-price

(expected-price merchant commodity city)

Find the price anticipated, given this world, by this merchant for this commodity in this city. If no information, assume 1. merchant should be passed as a map, commodity and city should be passed as keywords.

find-trade-plan

(find-trade-plan merchant world commodity)

Find the best destination in this world for this commodity given this merchant and this origin. If two cities are anticipated to offer the same price, the nearer should be preferred; if two are equally distant, the ones nearer to the merchant’s home should be preferred. merchant may be passed as a map or a keyword; commodity should be passed as a keyword.

+

Returns the augmented plan.

burden

(burden merchant world)

The total weight of the current cargo carried by this merchant in this world.

expected-price

(expected-price merchant commodity city)

Find the price anticipated, given this world, by this merchant for this commodity in this city. If no information, assume 1. merchant should be passed as a map, commodity and city should be passed as keywords.

find-trade-plan

(find-trade-plan merchant world commodity)

Find the best destination in this world for this commodity given this merchant and this origin. If two cities are anticipated to offer the same price, the nearer should be preferred; if two are equally distant, the ones nearer to the merchant’s home should be preferred. merchant may be passed as a map or a keyword; commodity should be passed as a keyword.

The returned plan is a map with keys:

-

:merchant - the id of the merchant for whom the plan was created;

-

:origin - the city from which the trade starts;

-

:destination - the city to which the trade is planned;

-

:commodity - the commodity to be carried;

-

:buy-price - the price at which that commodity can be bought;

-

:expected-price - the price at which the merchant anticipates

-
that `commodity` can be sold;
-
-

:distance - the number of stages in the planned journey

-

:dist-to-home - the distance from destination to the merchant’s

-
home city.
-

select-cargo

(select-cargo merchant world)

A merchant, in a given location in a world, will choose to buy a cargo within the limit they are capable of carrying, which they can anticipate selling for a profit at a destination.

\ No newline at end of file +

select-cargo

(select-cargo merchant world)

A merchant, in a given location in a world, will choose to buy a cargo within the limit they are capable of carrying, which they can anticipate selling for a profit at a destination.

\ No newline at end of file diff --git a/src/the_great_game/merchants/merchants.clj b/src/the_great_game/merchants/merchants.clj index 0eb7598..74d650b 100644 --- a/src/the_great_game/merchants/merchants.clj +++ b/src/the_great_game/merchants/merchants.clj @@ -46,15 +46,15 @@ The returned plan is a map with keys: - # :merchant - the id of the `merchant` for whom the plan was created; - # :origin - the city from which the trade starts; - # :destination - the city to which the trade is planned; - # :commodity - the `commodity` to be carried; - # :buy-price - the price at which that `commodity` can be bought; - # :expected-price - the price at which the `merchant` anticipates +* :merchant - the id of the `merchant` for whom the plan was created; +* :origin - the city from which the trade starts; +* :destination - the city to which the trade is planned; +* :commodity - the `commodity` to be carried; +* :buy-price - the price at which that `commodity` can be bought; +* :expected-price - the price at which the `merchant` anticipates that `commodity` can be sold; - # :distance - the number of stages in the planned journey - # :dist-to-home - the distance from `destination` to the `merchant`'s +* :distance - the number of stages in the planned journey +* :dist-to-home - the distance from `destination` to the `merchant`'s home city." [merchant world commodity] (let [m (cond