4 lines
8.2 KiB
HTML
4 lines
8.2 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
|
"">
|
|
<html><head><meta charset="UTF-8" /><title>the-great-game.merchants.strategies.simple documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">The-great-game</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="economy.html"><div class="inner"><span>Game world economy</span></div></a></li><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to the-great-game</span></div></a></li><li class="depth-1 "><a href="modelling_trading_cost_and_risk.html"><div class="inner"><span>Modelling trading cost and risk</span></div></a></li><li class="depth-1 "><a href="sexual-dimorphism.html"><div class="inner"><span>Sexual dimorphism</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>the-great-game</span></div></div></li><li class="depth-2 branch"><a href="the-great-game.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gossip</span></div></div></li><li class="depth-3"><a href="the-great-game.gossip.gossip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gossip</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>merchants</span></div></div></li><li class="depth-3 branch"><a href="the-great-game.merchants.markets.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>markets</span></div></a></li><li class="depth-3 branch"><a href="the-great-game.merchants.merchant-utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>merchant-utils</span></div></a></li><li class="depth-3 branch"><a href="the-great-game.merchants.merchants.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>merchants</span></div></a></li><li class="depth-3 branch"><a href="the-great-game.merchants.planning.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>planning</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>strategies</span></div></div></li><li class="depth-4 current"><a href="the-great-game.merchants.strategies.simple.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simple</span></div></a></li><li class="depth-2 branch"><a href="the-great-game.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>world</span></div></div></li><li class="depth-3 branch"><a href="the-great-game.world.routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></a></li><li class="depth-3 branch"><a href="the-great-game.world.run.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>run</span></div></a></li><li class="depth-3"><a href="the-great-game.world.world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>world</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="the-great-game.merchants.strategies.simple.html#var-move-merchant"><div class="inner"><span>move-merchant</span></div></a></li><li class="depth-1"><a href="the-great-game.merchants.strategies.simple.html#var-plan-and-buy"><div class="inner"><span>plan-and-buy</span></div></a></li><li class="depth-1"><a href="the-great-game.merchants.strategies.simple.html#var-re-plan"><div class="inner"><span>re-plan</span></div></a></li><li class="depth-1"><a href="the-great-game.merchants.strategies.simple.html#var-sell-and-buy"><div class="inner"><span>sell-and-buy</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">the-great-game.merchants.strategies.simple</h1><div class="doc"><div class="markdown"><p>Default trading strategy for merchants.</p>
|
|
<p>The simple strategy buys a single product in the local market if there is one which can be traded profitably, trades it to the chosen target market, and sells it there. If there is no commodity locally which can be traded profitably, moves towards home with no cargo. If at home and no commodity can be traded profitably, does not move.</p></div></div><div class="public anchor" id="var-move-merchant"><h3>move-merchant</h3><div class="usage"><code>(move-merchant merchant world)</code></div><div class="doc"><div class="markdown"><p>Handle general en route movement of this <code>merchant</code> in this <code>world</code>; return a (partial or full) world like this <code>world</code> but in which the merchant may have been moved ot updated.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/the_great_game/merchants/strategies/simple.clj#L126">view source</a></div></div><div class="public anchor" id="var-plan-and-buy"><h3>plan-and-buy</h3><div class="usage"><code>(plan-and-buy merchant world)</code></div><div class="doc"><div class="markdown"><p>Return a world like this <code>world</code>, in which this <code>merchant</code> has planned a new trade, and bought appropriate stock for it. If no profitable trade can be planned, the merchant is simply moved towards their home.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/the_great_game/merchants/strategies/simple.clj#L17">view source</a></div></div><div class="public anchor" id="var-re-plan"><h3>re-plan</h3><div class="usage"><code>(re-plan merchant world)</code></div><div class="doc"><div class="markdown"><p>Having failed to sell a cargo at current location, re-plan a route to sell the current cargo. Returns a revised world.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/the_great_game/merchants/strategies/simple.clj#L65">view source</a></div></div><div class="public anchor" id="var-sell-and-buy"><h3>sell-and-buy</h3><div class="usage"><code>(sell-and-buy merchant world)</code></div><div class="doc"><div class="markdown"><p>Return a new world like this <code>world</code>, in which this <code>merchant</code> has sold their current stock in their current location, and planned a new trade, and bought appropriate stock for it.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/the_great_game/merchants/strategies/simple.clj#L84">view source</a></div></div></div></body></html> |