the-great-game/docs/codox/cc.journeyman.the-great-game.agent.agent.html

24 lines
22 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.the-great-game.agent.agent 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.2-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="API_Spec.html"><div class="inner"><span>API Spec (unfinished)</span></div></a></li><li class="depth-1 "><a href="Appraisal.html"><div class="inner"><span>Appraisal (unfinished)</span></div></a></li><li class="depth-1 "><a href="Baking-the-world.html"><div class="inner"><span>Baking the world</span></div></a></li><li class="depth-1 "><a href="Biomes_and_ecology.html"><div class="inner"><span>Biomes and ecology (unfinished)</span></div></a></li><li class="depth-1 "><a href="Canonical-dictionary.html"><div class="inner"><span>A Canonical dictionary for this documentation</span></div></a></li><li class="depth-1 "><a href="Division_of_tasks_between_server_and_client.html"><div class="inner"><span>Division of tasks between server and client</span></div></a></li><li class="depth-1 "><a href="Dynamic-consequences.html"><div class="inner"><span>On the consequences of a dynamic game environment for storytelling</span></div></a></li><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="Further-reading.html"><div class="inner"><span>Further Reading (and watching)</span></div></a></li><li class="depth-1 "><a href="Game-engine-integration.html"><div class="inner"><span>Game-engine integration (unfinished)</span></div></a></li><li class="depth-1 "><a href="Game_Play.html"><div class="inner"><span>Game Play</span></div></a></li><li class="depth-1 "><a href="Gossip_scripted_plot_and_Johnny_Silverhand.html"><div class="inner"><span>Gossip, scripted plot, and Johnny Silverhand</span></div></a></li><li class="depth-1 "><a href="MVP-Roadmap.html"><div class="inner"><span>Minimum Viable Product, and a road map</span></div></a></li><li class="depth-1 "><a href="Modelling_democracy_and_morale.html"><div class="inner"><span>The Red Company: modelling democracy and morale (unfinished)</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 (unfinished)</span></div></a></li><li class="depth-1 "><a href="Naming-of-characters.html"><div class="inner"><span>Naming of Characters</span></div></a></li><li class="depth-1 "><a href="Not_my_problem.html"><div class="inner"><span> Not my problem</span></div></a></li><li class="depth-1 "><a href="On-dying.html"><div class="inner"><span>On Dying, and Injury</span></div></a></li><li class="depth-1 "><a href="On-sex-and-sexual-violence.html"><div class="inner"><span>On Sex, and Sexual Violence, in Games</span></div></a></li><li class="depth-1 "><a href="Organic_Quests.html"><div class="inner"><span>Organic Quests</span></div></a></li><li class="depth-1 "><a href="Pathmaking.html"><div class="inner"><span>Pathmaking</span></div></a></li><li class="depth-1 "><a href="Populating-a-game-world.html"><div class="inner"><span>Populating a game world</span></div></a></li><li class="depth-1 "><a href="Roadmap.html"><div class="inner"><span>Roadmap</span></div></a></li><li class="depth-1 "><a href="Selecting_Character.html"><div class="inner"><span>Selecting the Player Character</span></div></a></li><li class="depth-1 "><a href="Settling-a-game-world.html"><div class="inner"><span>Settling a game world</span></div></a></li><li class="depth-1 "><a href="Simulation-layers.html"><div class="inner"><span>Simulation layers</span></div></a></li><li class="depth-1 "><a href="The-spread-of-knowledge-in-a-large-game-world.html"><div class="inner"><span>The spread of knowledge in a large game world</span></div></a></li><li class="depth-1 "><a href="Things_Voice_Interaction_Enables.html"><div class="inner"><span>Things Voice Interaction Enables</span></div></a></li><li class="depth-1 "><a href="Uncanny_dialogue.html"><div class="inner"><span>The Uncanny Valley, and dynamically generated dialogue</span></div></a></li><li class="depth-1 "><a href="Voice-acting-considered-harmful.html"><div class="inner"><span>Voice acting considered harmful</span></div></a></li><li class="depth-1 "><a href="a-generic-planning-algorithm-for-craftworker-npcs.html"><div class="inner"><span>A Generic Planning Algorithm for craftworker NPCs</span></div></a></li><li class="depth-1 "><a href="building_on_microworld.html"><div class="inner"><span>Building on Microworld</span></div></a></li><li class="depth-1 "><a href="genetic-buildings.html"><div class="inner"><span>Genetic Buildings</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="sandbox.html"><div class="inner"><span>Sandbox</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>cc</span></div></div></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>journeyman</span></div></div></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>the-great-game</span></div></div></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>agent</span></div></div></li><li class="depth-5 branch current"><a href="cc.journeyman.the-great-game.agent.agent.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>agent</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.agent.schedule.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>schedule</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>buildings</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.buildings.module.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>module</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.buildings.rectangular.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rectangular</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.cloverage.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>cloverage</span></div></a></li><li class="depth-4"><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-5 branch"><a href="cc.journeyman.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-5"><a href="cc.journeyman.the-great-game.gossip.news-items.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>news-items</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>holdings</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.holdings.holding.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>holding</span></div></a></li><li class="depth-4"><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>location</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.location.location.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>location</span></div></a></li><li class="depth-4"><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>lore</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.lore.digester.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>digester</span></div></a></li><li class="depth-4"><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-5 branch"><a href="cc.journeyman.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-5 branch"><a href="cc.journeyman.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-5 branch"><a href="cc.journeyman.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-5 branch"><a href="cc.journeyman.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-5"><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-6"><a href="cc.journeyman.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-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>objects</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.objects.character.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>character</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.objects.container.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>container</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.objects.game-object.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>game-object</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.playroom.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>playroom</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4"><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-5 branch"><a href="cc.journeyman.the-great-game.world.heightmap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>heightmap</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.world.location.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>location</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.world.mw.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.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-5"><a href="cc.journeyman.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="cc.journeyman.the-great-game.agent.agent.html#var-ProtoAgent"><div class="inner"><span>ProtoAgent</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-act"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>act</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-hungry.3F"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>hungry?</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-pending-intentions"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pending-intentions</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-pending-scheduled-action.3F"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pending-scheduled-action?</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-plan-fight-or-flight"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>plan-fight-or-flight</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-plan-find-food"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>plan-find-food</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-plan-find-rest"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>plan-find-rest</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-plan-goal"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>plan-goal</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-plan-scheduled-action"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>plan-scheduled-action</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-schedule"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>schedule</span></div></a></li><li class="depth-2 branch"><a href="cc.journeyman.the-great-game.agent.agent.html#var-threatened.3F"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>threatened?</span></div></a></li><li class="depth-2"><a href="cc.journeyman.the-great-game.agent.agent.html#var-tired.3F"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tired?</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.the-great-game.agent.agent</h1><div class="doc"><div class="markdown"><p>Anything in the game world with agency; primarily but not exclusively characters.</p>
</div></div><div class="public anchor" id="var-ProtoAgent"><h3>ProtoAgent</h3><h4 class="type">protocol</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>An object which can act in the world</p>
</div></div><div class="members"><h4>members</h4><div class="inner"><div class="public anchor" id="var-act"><h3>act</h3><div class="usage"><code>(act actor world circle)</code></div><div class="doc"><div class="markdown"><p>Allow <code>actor</code> to do something in this <code>world</code>, in the context of this <code>circle</code>; return the new state of the actor if something was done, <code>nil</code> if nothing was done. <code>Circle</code> is expected to be one of</p>
<ul>
<li><code>:active</code> - actors within visual/audible range of the player character;</li>
<li><code>:pending</code> - actors not in the active circle, but sufficiently close to it that they may enter the active circle within a short period;</li>
<li><code>:background</code> - actors who are active in the background in order to handle trade, news, et cetera;</li>
<li><code>:other</code> - actors who are not members of any other circle.</li>
</ul>
<p>The <code>act</code> method <em>must not</em> have side effects; it must <em>only</em> return a new state. If the actors intention is to seek to change the state of something else in the game world, it must add a representation of that intention to the sequence which will be returned by its <code>pending-intentions</code> method.</p>
</div></div></div><div class="public anchor" id="var-hungry.3F"><h3>hungry?</h3><div class="usage"><code>(hungry? actor world circle)</code></div><div class="doc"><div class="markdown"><p>True if this actor is hungry and has no immediate access to food.</p>
</div></div></div><div class="public anchor" id="var-pending-intentions"><h3>pending-intentions</h3><div class="usage"><code>(pending-intentions actor)</code></div><div class="doc"><div class="markdown"><p>Returns a sequence of effects an actor intends, as a consequence of acting.</p>
</div></div></div><div class="public anchor" id="var-pending-scheduled-action.3F"><h3>pending-scheduled-action?</h3><div class="usage"><code>(pending-scheduled-action? actor world circle)</code></div><div class="doc"><div class="markdown"><p>True if there is a plan in this <code>actor</code>s schedule which should be activated now. NOTE THAT plans in the <code>daily</code> schedule are NOT activated when in circles <code>:background</code> or <code>:other</code></p>
</div></div></div><div class="public anchor" id="var-plan-fight-or-flight"><h3>plan-fight-or-flight</h3><div class="usage"><code>(plan-fight-or-flight actor world circle)</code></div><div class="doc"><div class="markdown"><p>Return a plan to resolve any active threat to this <code>actor</code> in this <code>world</code>.</p>
</div></div></div><div class="public anchor" id="var-plan-find-food"><h3>plan-find-food</h3><div class="usage"><code>(plan-find-food actor workd circle)</code></div><div class="doc"><div class="markdown"><p>Return a plan to find this <code>actor</code> food in this <code>world</code>.</p>
</div></div></div><div class="public anchor" id="var-plan-find-rest"><h3>plan-find-rest</h3><div class="usage"><code>(plan-find-rest actor workd circle)</code></div><div class="doc"><div class="markdown"><p>Return a plan to find this <code>actor</code> a safe place to rest, or if in one, to actually rest, in this <code>world</code>.</p>
</div></div></div><div class="public anchor" id="var-plan-goal"><h3>plan-goal</h3><div class="usage"><code>(plan-goal actor world circle)</code></div><div class="doc"><div class="markdown"><p>Return a plan to advance this <code>actor</code> towards their personal objective, in this world, or <code>nil</code> for default actors with no objective.</p>
</div></div></div><div class="public anchor" id="var-plan-scheduled-action"><h3>plan-scheduled-action</h3><div class="usage"><code>(plan-scheduled-action actor workd circle)</code></div><div class="doc"><div class="markdown"><p>Return a plan taken from the schedule of this actor for the current date and time, if any, else <code>nil</code>.</p>
</div></div></div><div class="public anchor" id="var-schedule"><h3>schedule</h3><div class="usage"><code>(schedule actor)</code></div><div class="doc"><div class="markdown"><p>Return a map of scheduled actions for this <code>actor</code>. TODO: work out the detailed format!</p>
</div></div></div><div class="public anchor" id="var-threatened.3F"><h3>threatened?</h3><div class="usage"><code>(threatened? actor world circle)</code></div><div class="doc"><div class="markdown"><p>True if this <code>actor</code> is threatened in this <code>world</code>.</p>
</div></div></div><div class="public anchor" id="var-tired.3F"><h3>tired?</h3><div class="usage"><code>(tired? actor world circle)</code></div><div class="doc"><div class="markdown"><p>True if this <code>actor</code> needs rest.</p>
</div></div></div></div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/the_great_game/agent/agent.clj#L15">view source</a></div></div></div></body></html>