Today is the Fifth Plough of the Plough

Implemented almost the whole of the Myth of the God Incarnate calendar
This commit is contained in:
Simon Brooke 2020-04-14 08:30:41 +01:00
parent bd76e93568
commit 7e7a55c8ec
39 changed files with 2085 additions and 167 deletions

2
.gitignore vendored
View file

@ -17,5 +17,3 @@ pom.xml.asc
.nrepl-port
.cpcache/
*~
docs/cloverage/

View file

@ -15,19 +15,15 @@
<td class="with-number">Total</td><td class="with-number">Blank</td><td class="with-number">Instrumented</td>
</tr></thead>
<tr>
<td><a href="the_great_game/core.clj.html">the-great-game.core</a></td><td class="with-bar"><div class="covered"
style="width:33.333333333333336%;
float:left;"> 2 </div><div class="not-covered"
style="width:66.66666666666667%;
float:left;"> 4 </div></td>
<td class="with-number">33.33 %</td>
<td class="with-bar"><div class="covered"
style="width:66.66666666666667%;
float:left;"> 2 </div><div class="not-covered"
style="width:33.333333333333336%;
<td><a href="the_great_game/agent/agent.clj.html">the-great-game.agent.agent</a></td><td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 1 </div></td>
<td class="with-number">66.67 %</td>
<td class="with-number">6</td><td class="with-number">1</td><td class="with-number">3</td>
<td class="with-number">100.00 %</td>
<td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 1 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">7</td><td class="with-number">2</td><td class="with-number">1</td>
</tr>
<tr>
<td><a href="the_great_game/gossip/gossip.clj.html">the-great-game.gossip.gossip</a></td><td class="with-bar"><div class="covered"
@ -45,38 +41,55 @@
<td class="with-number">65</td><td class="with-number">5</td><td class="with-number">39</td>
</tr>
<tr>
<td><a href="the_great_game/merchants/markets.clj.html">the-great-game.merchants.markets</a></td><td class="with-bar"><div class="covered"
style="width:75.11737089201878%;
float:left;"> 160 </div><div class="not-covered"
style="width:24.88262910798122%;
float:left;"> 53 </div></td>
<td class="with-number">75.12 %</td>
<td><a href="the_great_game/gossip/news_items.clj.html">the-great-game.gossip.news-items</a></td><td class="with-bar"><div class="covered"
style="width:89.34108527131782%;
float:left;"> 461 </div><div class="not-covered"
style="width:10.65891472868217%;
float:left;"> 55 </div></td>
<td class="with-number">89.34 %</td>
<td class="with-bar"><div class="covered"
style="width:56.81818181818182%;
float:left;"> 25 </div><div class="partial"
style="width:11.363636363636363%;
float:left;"> 5 </div><div class="not-covered"
style="width:31.818181818181817%;
float:left;"> 14 </div></td>
<td class="with-number">68.18 %</td>
style="width:83.65384615384616%;
float:left;"> 87 </div><div class="partial"
style="width:8.653846153846153%;
float:left;"> 9 </div><div class="not-covered"
style="width:7.6923076923076925%;
float:left;"> 8 </div></td>
<td class="with-number">92.31 %</td>
<td class="with-number">244</td><td class="with-number">29</td><td class="with-number">104</td>
</tr>
<tr>
<td><a href="the_great_game/merchants/markets.clj.html">the-great-game.merchants.markets</a></td><td class="with-bar"><div class="covered"
style="width:96.71361502347418%;
float:left;"> 206 </div><div class="not-covered"
style="width:3.2863849765258215%;
float:left;"> 7 </div></td>
<td class="with-number">96.71 %</td>
<td class="with-bar"><div class="covered"
style="width:93.18181818181819%;
float:left;"> 41 </div><div class="partial"
style="width:4.545454545454546%;
float:left;"> 2 </div><div class="not-covered"
style="width:2.272727272727273%;
float:left;"> 1 </div></td>
<td class="with-number">97.73 %</td>
<td class="with-number">84</td><td class="with-number">8</td><td class="with-number">44</td>
</tr>
<tr>
<td><a href="the_great_game/merchants/merchant_utils.clj.html">the-great-game.merchants.merchant-utils</a></td><td class="with-bar"><div class="covered"
style="width:46.017699115044245%;
float:left;"> 104 </div><div class="not-covered"
style="width:53.982300884955755%;
float:left;"> 122 </div></td>
<td class="with-number">46.02 %</td>
style="width:66.12377850162866%;
float:left;"> 203 </div><div class="not-covered"
style="width:33.876221498371336%;
float:left;"> 104 </div></td>
<td class="with-number">66.12 %</td>
<td class="with-bar"><div class="covered"
style="width:54.09836065573771%;
float:left;"> 33 </div><div class="partial"
style="width:4.918032786885246%;
float:left;"> 3 </div><div class="not-covered"
style="width:40.98360655737705%;
float:left;"> 25 </div></td>
<td class="with-number">59.02 %</td>
<td class="with-number">92</td><td class="with-number">7</td><td class="with-number">61</td>
style="width:66.66666666666667%;
float:left;"> 48 </div><div class="partial"
style="width:5.555555555555555%;
float:left;"> 4 </div><div class="not-covered"
style="width:27.77777777777778%;
float:left;"> 20 </div></td>
<td class="with-number">72.22 %</td>
<td class="with-number">106</td><td class="with-number">7</td><td class="with-number">72</td>
</tr>
<tr>
<td><a href="the_great_game/merchants/merchants.clj.html">the-great-game.merchants.merchants</a></td><td class="with-bar"><div class="covered"
@ -125,6 +138,23 @@
<td class="with-number">4.03 %</td>
<td class="with-number">173</td><td class="with-number">6</td><td class="with-number">124</td>
</tr>
<tr>
<td><a href="the_great_game/time.clj.html">the-great-game.time</a></td><td class="with-bar"><div class="covered"
style="width:98.10606060606061%;
float:left;"> 259 </div><div class="not-covered"
style="width:1.893939393939394%;
float:left;"> 5 </div></td>
<td class="with-number">98.11 %</td>
<td class="with-bar"><div class="covered"
style="width:96.66666666666667%;
float:left;"> 58 </div><div class="partial"
style="width:1.6666666666666667%;
float:left;"> 1 </div><div class="not-covered"
style="width:1.6666666666666667%;
float:left;"> 1 </div></td>
<td class="with-number">98.33 %</td>
<td class="with-number">144</td><td class="with-number">21</td><td class="with-number">60</td>
</tr>
<tr>
<td><a href="the_great_game/utils.clj.html">the-great-game.utils</a></td><td class="with-bar"><div class="covered"
style="width:100.0%;
@ -136,6 +166,23 @@
<td class="with-number">100.00 %</td>
<td class="with-number">35</td><td class="with-number">3</td><td class="with-number">19</td>
</tr>
<tr>
<td><a href="the_great_game/world/location.clj.html">the-great-game.world.location</a></td><td class="with-bar"><div class="covered"
style="width:88.37209302325581%;
float:left;"> 76 </div><div class="not-covered"
style="width:11.627906976744185%;
float:left;"> 10 </div></td>
<td class="with-number">88.37 %</td>
<td class="with-bar"><div class="covered"
style="width:70.58823529411765%;
float:left;"> 12 </div><div class="partial"
style="width:17.647058823529413%;
float:left;"> 3 </div><div class="not-covered"
style="width:11.764705882352942%;
float:left;"> 2 </div></td>
<td class="with-number">88.24 %</td>
<td class="with-number">37</td><td class="with-number">4</td><td class="with-number">17</td>
</tr>
<tr>
<td><a href="the_great_game/world/routes.clj.html">the-great-game.world.routes</a></td><td class="with-bar"><div class="covered"
style="width:99.21875%;
@ -183,9 +230,9 @@
</tr>
<tr><td>Totals:</td>
<td class="with-bar"></td>
<td class="with-number">51.99 %</td>
<td class="with-number">66.14 %</td>
<td class="with-bar"></td>
<td class="with-number">54.62 %</td>
<td class="with-number">67.89 %</td>
</tr>
</table>
</body>

View file

@ -0,0 +1,29 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> the_great_game/agent/agent.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;the-great-game.agent.agent
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Anything&nbsp;in&nbsp;the&nbsp;game&nbsp;world&nbsp;with&nbsp;agency&quot;)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
003&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;;;&nbsp;&nbsp;hierarchy&nbsp;of&nbsp;needs&nbsp;probably&nbsp;gets&nbsp;implemented&nbsp;here
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;&nbsp;&nbsp;I&#x27;m&nbsp;probably&nbsp;going&nbsp;to&nbsp;want&nbsp;to&nbsp;defprotocol&nbsp;stuff,&nbsp;to&nbsp;define&nbsp;the&nbsp;hierarchy
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;&nbsp;&nbsp;of&nbsp;things&nbsp;in&nbsp;the&nbsp;gameworld;&nbsp;either&nbsp;that&nbsp;or&nbsp;drop&nbsp;to&nbsp;Java,&nbsp;wich&nbsp;I&#x27;d&nbsp;rather&nbsp;not&nbsp;do.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -8,7 +8,7 @@
001&nbsp;&nbsp;(ns&nbsp;the-great-game.gossip.gossip
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Interchange&nbsp;of&nbsp;news&nbsp;events&nbsp;between&nbsp;agents&nbsp;agents&quot;
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Interchange&nbsp;of&nbsp;news&nbsp;events&nbsp;between&nbsp;gossip&nbsp;agents&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[the-great-game.utils&nbsp;:refer&nbsp;[deep-merge]]))
@ -140,7 +140,7 @@
045&nbsp;&nbsp;&nbsp;&nbsp;`new-location`.&nbsp;Many&nbsp;gossips&nbsp;are&nbsp;essentially&nbsp;shadow-records&nbsp;of&nbsp;agents&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;other&nbsp;types,&nbsp;and&nbsp;the&nbsp;movement&nbsp;if&nbsp;the&nbsp;gossip&nbsp;should&nbsp;be&nbsp;controlled&nbsp;by&nbsp;the
046&nbsp;&nbsp;&nbsp;&nbsp;other&nbsp;types,&nbsp;and&nbsp;the&nbsp;movement&nbsp;of&nbsp;the&nbsp;gossip&nbsp;should&nbsp;be&nbsp;controlled&nbsp;by&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;run&nbsp;function&nbsp;of&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;record&nbsp;they&nbsp;shadow.&nbsp;The&nbsp;[[#run]]&nbsp;function

View file

@ -0,0 +1,740 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> the_great_game/gossip/news_items.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;the-great-game.gossip.news-items
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Categories&nbsp;of&nbsp;news&nbsp;events&nbsp;interesting&nbsp;to&nbsp;gossip&nbsp;agents&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[the-great-game.world.location&nbsp;:refer&nbsp;[distance-between]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[the-great-game.time&nbsp;:refer&nbsp;[now]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
005&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;&nbsp;The&nbsp;ideas&nbsp;here&nbsp;are&nbsp;based&nbsp;on&nbsp;the&nbsp;essay&nbsp;&#x27;The&nbsp;spread&nbsp;of&nbsp;knowledge&nbsp;in&nbsp;a&nbsp;large
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;&nbsp;game&nbsp;world&#x27;,&nbsp;q.v.;&nbsp;they&#x27;ve&nbsp;advanced&nbsp;a&nbsp;little&nbsp;beyond&nbsp;that&nbsp;and&nbsp;will&nbsp;doubtless
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;&nbsp;advance&nbsp;further&nbsp;in&nbsp;the&nbsp;course&nbsp;of&nbsp;writing&nbsp;and&nbsp;debugging&nbsp;this&nbsp;namespace.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;&nbsp;A&nbsp;news&nbsp;item&nbsp;is&nbsp;a&nbsp;map&nbsp;with&nbsp;the&nbsp;keys:
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;&nbsp;*&nbsp;`date`&nbsp;-&nbsp;the&nbsp;date&nbsp;on&nbsp;which&nbsp;the&nbsp;reported&nbsp;event&nbsp;happened;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;&nbsp;*&nbsp;`nth-hand`&nbsp;-&nbsp;the&nbsp;number&nbsp;of&nbsp;agents&nbsp;the&nbsp;news&nbsp;item&nbsp;has&nbsp;passed&nbsp;through;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;&nbsp;*&nbsp;`verb`&nbsp;-&nbsp;what&nbsp;it&nbsp;is&nbsp;that&nbsp;happened&nbsp;(key&nbsp;into&nbsp;`news-topics`);
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;&nbsp;plus&nbsp;other&nbsp;keys&nbsp;taken&nbsp;from&nbsp;the&nbsp;`keys`&nbsp;value&nbsp;associated&nbsp;with&nbsp;the&nbsp;verb&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;&nbsp;`news-topics`
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
018&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
019&nbsp;&nbsp;(def&nbsp;news-topics
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&quot;Topics&nbsp;of&nbsp;interest&nbsp;to&nbsp;gossip&nbsp;agents.&nbsp;Topics&nbsp;are&nbsp;keyed&nbsp;in&nbsp;this&nbsp;map&nbsp;by
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;their&nbsp;`verbs`.&nbsp;The&nbsp;`keys`&nbsp;associated&nbsp;with&nbsp;each&nbsp;topic&nbsp;are&nbsp;the&nbsp;extra&nbsp;pieces
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;information&nbsp;required&nbsp;to&nbsp;give&nbsp;context&nbsp;to&nbsp;a&nbsp;gossip&nbsp;item.&nbsp;Generally:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
023&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`actor`&nbsp;is&nbsp;the&nbsp;id&nbsp;of&nbsp;the&nbsp;character&nbsp;who&nbsp;it&nbsp;is&nbsp;reported&nbsp;performed&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;action;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`other`&nbsp;is&nbsp;the&nbsp;id&nbsp;of&nbsp;the&nbsp;character&nbsp;on&nbsp;whom&nbsp;it&nbsp;is&nbsp;reported&nbsp;the&nbsp;action
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;was&nbsp;performed;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`location`&nbsp;is&nbsp;the&nbsp;place&nbsp;at&nbsp;which&nbsp;the&nbsp;action&nbsp;was&nbsp;performed;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`object`&nbsp;is&nbsp;an&nbsp;object&nbsp;(or&nbsp;possibly&nbsp;list&nbsp;of&nbsp;objects?)&nbsp;relevant&nbsp;to&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;action;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`price`&nbsp;is&nbsp;special&nbsp;to&nbsp;buy&#x2F;sell,&nbsp;but&nbsp;of&nbsp;significant&nbsp;interest&nbsp;to&nbsp;merchants.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;####&nbsp;Notes:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
034&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;#####&nbsp;Characters:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
036&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;*TODO*&nbsp;but&nbsp;note&nbsp;that&nbsp;at&nbsp;most&nbsp;all&nbsp;the&nbsp;receiver&nbsp;can&nbsp;learn&nbsp;about&nbsp;a&nbsp;character
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;a&nbsp;news&nbsp;item&nbsp;is&nbsp;what&nbsp;the&nbsp;giver&nbsp;knows&nbsp;about&nbsp;that&nbsp;character,&nbsp;degraded&nbsp;by
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;what&nbsp;the&nbsp;receiver&nbsp;finds&nbsp;interesting&nbsp;about&nbsp;them.&nbsp;If&nbsp;we&nbsp;just&nbsp;pass&nbsp;the&nbsp;id&nbsp;here,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;either&nbsp;the&nbsp;receiver&nbsp;knows&nbsp;everything&nbsp;in&nbsp;the&nbsp;database&nbsp;about&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;character,&nbsp;or&nbsp;else&nbsp;the&nbsp;receiver&nbsp;knows&nbsp;nothing&nbsp;at&nbsp;all&nbsp;about&nbsp;the&nbsp;character.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;Neither&nbsp;is&nbsp;desirable.&nbsp;Further&nbsp;thought&nbsp;needed.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
043&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;#####&nbsp;Locations:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;&#x27;location&#x27;&nbsp;value&nbsp;is&nbsp;a&nbsp;list&nbsp;comprising&nbsp;at&nbsp;most&nbsp;the&nbsp;x&#x2F;y&nbsp;coordinate&nbsp;location
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;the&nbsp;ids&nbsp;of&nbsp;the&nbsp;settlement&nbsp;and&nbsp;region&nbsp;(possibly&nbsp;hierarchically)&nbsp;that&nbsp;contain
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;location.&nbsp;If&nbsp;the&nbsp;x&#x2F;y&nbsp;is&nbsp;not&nbsp;local&nbsp;to&nbsp;the&nbsp;home&nbsp;of&nbsp;the&nbsp;receiving&nbsp;agent,&nbsp;they
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;won&#x27;t&nbsp;remember&nbsp;it&nbsp;and&nbsp;won&#x27;t&nbsp;pass&nbsp;it&nbsp;on;&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;ids&nbsp;are&nbsp;not&nbsp;interesting
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;So&nbsp;location&nbsp;information&nbsp;will&nbsp;degrade&nbsp;progressively&nbsp;as&nbsp;the&nbsp;item&nbsp;is&nbsp;passed&nbsp;along.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
051&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;It&nbsp;is&nbsp;assumed&nbsp;that&nbsp;the&nbsp;`:home`&nbsp;of&nbsp;a&nbsp;character&nbsp;is&nbsp;a&nbsp;location&nbsp;in&nbsp;this&nbsp;sense.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
053&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;#####&nbsp;Inferences:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
055&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;an&nbsp;agent&nbsp;learns&nbsp;that&nbsp;Adam&nbsp;has&nbsp;married&nbsp;Betty,&nbsp;they&nbsp;can&nbsp;infer&nbsp;that&nbsp;Betty&nbsp;has
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;married&nbsp;Adam;&nbsp;if&nbsp;they&nbsp;learn&nbsp;that&nbsp;Charles&nbsp;killed&nbsp;Dorothy,&nbsp;that&nbsp;Dorothy&nbsp;has&nbsp;died.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;I&#x27;m&nbsp;not&nbsp;convinced&nbsp;that&nbsp;my&nbsp;representation&nbsp;of&nbsp;inferences&nbsp;here&nbsp;is&nbsp;ideal.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&quot;
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;;;&nbsp;A&nbsp;significant&nbsp;attack&nbsp;is&nbsp;interesting&nbsp;whether&nbsp;or&nbsp;not&nbsp;it&nbsp;leads&nbsp;to&nbsp;deaths
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:attack&nbsp;{:verb&nbsp;:attack&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Deaths&nbsp;of&nbsp;characters&nbsp;may&nbsp;be&nbsp;interesting
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:die&nbsp;{:verb&nbsp;:attack&nbsp;:keys&nbsp;[:actor&nbsp;:location]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Deliberate&nbsp;killings&nbsp;are&nbsp;interesting.
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:kill&nbsp;{:verb&nbsp;:kill&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:inferences&nbsp;[{:verb&nbsp;:die&nbsp;:actor&nbsp;:other&nbsp;:other&nbsp;:nil}]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Marriages&nbsp;may&nbsp;be&nbsp;interesting
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:marry&nbsp;{:verb&nbsp;:marry&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:inferences&nbsp;[{:verb&nbsp;:marry&nbsp;:actor&nbsp;:other&nbsp;:other&nbsp;:actor}]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;The&nbsp;end&nbsp;of&nbsp;ongoing&nbsp;open&nbsp;conflict&nbsp;between&nbsp;to&nbsp;characters&nbsp;may&nbsp;be&nbsp;interesting
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:peace&nbsp;{:verb&nbsp;:peace&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:inferences&nbsp;[{:verb&nbsp;:peace&nbsp;:actor&nbsp;:other&nbsp;:other&nbsp;:actor}]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Things&nbsp;related&nbsp;to&nbsp;the&nbsp;plot&nbsp;are&nbsp;interesting,&nbsp;but&nbsp;will&nbsp;require&nbsp;special
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;handling.&nbsp;Extra&nbsp;keys&nbsp;may&nbsp;be&nbsp;required&nbsp;by&nbsp;particular&nbsp;plot&nbsp;events.
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:plot&nbsp;{:verb&nbsp;:plot&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:object&nbsp;:location]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Rapes&nbsp;are&nbsp;interesting.
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:rape&nbsp;{:verb&nbsp;:rape&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Should&nbsp;you&nbsp;also&nbsp;infer&nbsp;from&nbsp;rape&nbsp;that&nbsp;actor&nbsp;is&nbsp;male&nbsp;and&nbsp;adult?
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:inferences&nbsp;[{:verb&nbsp;:attack}
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:verb&nbsp;:sex}
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:verb&nbsp;:sex&nbsp;:actor&nbsp;:other&nbsp;:other&nbsp;:actor}]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Merchants,&nbsp;especially,&nbsp;are&nbsp;interested&nbsp;in&nbsp;prices&nbsp;in&nbsp;other&nbsp;markets
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:sell&nbsp;{:verb&nbsp;:sell&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:object&nbsp;:location&nbsp;:price]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Sex&nbsp;can&nbsp;juicy&nbsp;gossip,&nbsp;although&nbsp;not&nbsp;normally&nbsp;if&nbsp;the&nbsp;participants&nbsp;are&nbsp;in&nbsp;an
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;established&nbsp;sexual&nbsp;relationship.
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:sex&nbsp;{:verb&nbsp;:sex&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:inferences&nbsp;[{:verb&nbsp;:sex&nbsp;:actor&nbsp;:other&nbsp;:other&nbsp;:actor}]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Thefts&nbsp;are&nbsp;interesting
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:steal&nbsp;{:verb&nbsp;:steal&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:object&nbsp;:location]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;The&nbsp;succession&nbsp;of&nbsp;rulers&nbsp;is&nbsp;interesting;&nbsp;of&nbsp;respected&nbsp;craftsmen,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;potentially&nbsp;also&nbsp;interesting.
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:succession&nbsp;{:verb&nbsp;:succession&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location&nbsp;:rank]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;The&nbsp;start&nbsp;of&nbsp;ongoing&nbsp;open&nbsp;conflict&nbsp;between&nbsp;to&nbsp;characters&nbsp;may&nbsp;be&nbsp;interesting
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:war&nbsp;{:verb&nbsp;:war&nbsp;:keys&nbsp;[:actor&nbsp;:other&nbsp;:location]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:inferences&nbsp;[{:verb&nbsp;:war&nbsp;:actor&nbsp;:other&nbsp;:other&nbsp;:actor}]}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
097&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
098&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
099&nbsp;&nbsp;(defn&nbsp;interest-in-character
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&quot;Integer&nbsp;representation&nbsp;of&nbsp;how&nbsp;interesting&nbsp;this&nbsp;`character`&nbsp;is&nbsp;to&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;`gossip`.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;*TODO:*&nbsp;this&nbsp;assumes&nbsp;that&nbsp;characters&nbsp;are&nbsp;passed&nbsp;as&nbsp;keywords,&nbsp;but,&nbsp;as
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;documented&nbsp;above,&nbsp;they&nbsp;probably&nbsp;have&nbsp;to&nbsp;be&nbsp;maps,&nbsp;to&nbsp;allow&nbsp;for&nbsp;degradation.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;character]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;(count
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(concat
</span><br/>
<span class="partial" title="6 out of 12 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter&nbsp;#(=&nbsp;(:actor&nbsp;%&nbsp;character))&nbsp;(:knowledge&nbsp;gossip))
</span><br/>
<span class="partial" title="6 out of 12 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter&nbsp;#(=&nbsp;(:other&nbsp;%&nbsp;character))&nbsp;(:knowledge&nbsp;gossip)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
109&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
110&nbsp;&nbsp;(defn&nbsp;interesting-character?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&quot;Boolean&nbsp;representation&nbsp;of&nbsp;whether&nbsp;this&nbsp;`character`&nbsp;is&nbsp;interesting&nbsp;to&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;`gossip`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;character]
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;(&gt;&nbsp;(interest-in-character&nbsp;gossip&nbsp;character)&nbsp;0))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
115&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
116&nbsp;&nbsp;(defn&nbsp;interest-in-location
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;&quot;Integer&nbsp;representation&nbsp;of&nbsp;how&nbsp;interesting&nbsp;this&nbsp;`location`&nbsp;is&nbsp;to&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;`gossip`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;location]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="partial" title="20 out of 21 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(map?&nbsp;location)&nbsp;(number?&nbsp;(:x&nbsp;location))&nbsp;(number?&nbsp;(:y&nbsp;location)))
</span><br/>
<span class="partial" title="8 out of 9 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if-let&nbsp;[home&nbsp;(:home&nbsp;gossip)]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[d&nbsp;(distance-between&nbsp;location&nbsp;home)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;(&#x2F;&nbsp;10000&nbsp;d)&nbsp;;;&nbsp;10000&nbsp;at&nbsp;metre&nbsp;scale&nbsp;is&nbsp;10km;&nbsp;interest&nbsp;should
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;fall&nbsp;of&nbsp;with&nbsp;distance&nbsp;from&nbsp;home,&nbsp;but&nbsp;possibly&nbsp;on&nbsp;a&nbsp;log&nbsp;scale
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(&gt;&nbsp;i&nbsp;1)&nbsp;i&nbsp;0))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(coll?&nbsp;location)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(interest-in-location&nbsp;gossip&nbsp;%)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(count
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(some&nbsp;(fn&nbsp;[x]&nbsp;(=&nbsp;x&nbsp;location))&nbsp;(:location&nbsp;%))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:knowledge&nbsp;gossip)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
140&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
141&nbsp;&nbsp;(defn&nbsp;interesting-location?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
142&nbsp;&nbsp;&nbsp;&nbsp;&quot;True&nbsp;if&nbsp;the&nbsp;location&nbsp;of&nbsp;this&nbsp;news&nbsp;`item`&nbsp;is&nbsp;interesting&nbsp;to&nbsp;this&nbsp;`gossip`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
143&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;item]
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;(&gt;&nbsp;(interest-in-location&nbsp;gossip&nbsp;(:location&nbsp;item))&nbsp;1))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
145&nbsp;&nbsp;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
146&nbsp;&nbsp;(defn&nbsp;interesting-object?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;object]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;Not&nbsp;yet&nbsp;(really)&nbsp;implemented
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;true)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
150&nbsp;&nbsp;
</span><br/>
<span class="partial" title="1 out of 2 forms covered">
151&nbsp;&nbsp;(defn&nbsp;interesting-topic?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;topic]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;Not&nbsp;yet&nbsp;(really)&nbsp;implemented
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;true)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
155&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
156&nbsp;&nbsp;(defn&nbsp;interesting-item?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
157&nbsp;&nbsp;&nbsp;&nbsp;&quot;True&nbsp;if&nbsp;anything&nbsp;about&nbsp;this&nbsp;news&nbsp;`item`&nbsp;is&nbsp;interesting&nbsp;to&nbsp;this&nbsp;`gossip`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
158&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;item]
</span><br/>
<span class="partial" title="13 out of 17 forms covered">
159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(or
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
160&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interesting-character?&nbsp;gossip&nbsp;(:actor&nbsp;item))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interesting-character?&nbsp;gossip&nbsp;(:other&nbsp;item))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interesting-location?&nbsp;gossip&nbsp;(:location&nbsp;item))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interesting-object?&nbsp;gossip&nbsp;(:object&nbsp;item))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interesting-topic?&nbsp;gossip&nbsp;(:verb&nbsp;item))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
165&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
166&nbsp;&nbsp;(defn&nbsp;infer
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
167&nbsp;&nbsp;&nbsp;&nbsp;&quot;Infer&nbsp;a&nbsp;new&nbsp;knowledge&nbsp;item&nbsp;from&nbsp;this&nbsp;`item`,&nbsp;following&nbsp;this&nbsp;`rule`&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
168&nbsp;&nbsp;&nbsp;&nbsp;[item&nbsp;rule]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
169&nbsp;&nbsp;&nbsp;&nbsp;(reduce&nbsp;merge
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:verb&nbsp;(:verb&nbsp;rule)}
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;(fn&nbsp;[k]&nbsp;{k&nbsp;(apply&nbsp;(k&nbsp;rule)&nbsp;(list&nbsp;item))})
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(=&nbsp;%&nbsp;:verb)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
176&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;rule))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
177&nbsp;&nbsp;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
178&nbsp;&nbsp;(declare&nbsp;learn-news-item)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
179&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
180&nbsp;&nbsp;(defn&nbsp;make-all-inferences
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
181&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;list&nbsp;of&nbsp;knowledge&nbsp;entries&nbsp;inferred&nbsp;from&nbsp;this&nbsp;news&nbsp;`item`&nbsp;by&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
182&nbsp;&nbsp;&nbsp;&nbsp;`gossip`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
183&nbsp;&nbsp;&nbsp;&nbsp;[item]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
184&nbsp;&nbsp;&nbsp;&nbsp;(set
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
185&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
186&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;concat
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
187&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
188&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(:knowledge&nbsp;(learn-news-item&nbsp;{}&nbsp;(infer&nbsp;item&nbsp;%)&nbsp;false))
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
189&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:inferences&nbsp;(news-topics&nbsp;(:verb&nbsp;item)))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
190&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
191&nbsp;&nbsp;(defn&nbsp;degrade-character
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
192&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;character&nbsp;specification&nbsp;like&nbsp;this&nbsp;`character`,&nbsp;but&nbsp;comprising
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
193&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;those&nbsp;properties&nbsp;this&nbsp;`gossip`&nbsp;is&nbsp;interested&nbsp;in.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
194&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;character]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
195&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;Not&nbsp;yet&nbsp;(really)&nbsp;implemented
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
196&nbsp;&nbsp;&nbsp;&nbsp;character)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
197&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
198&nbsp;&nbsp;(defn&nbsp;degrade-location
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
199&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;location&nbsp;specification&nbsp;like&nbsp;this&nbsp;`location`,&nbsp;but&nbsp;comprising
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
200&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;those&nbsp;elements&nbsp;this&nbsp;`gossip`&nbsp;is&nbsp;interested&nbsp;in.&nbsp;If&nbsp;none,&nbsp;return
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
201&nbsp;&nbsp;&nbsp;&nbsp;`nil`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
202&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;location]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
203&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[l&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
204&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(coll?&nbsp;location)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
205&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="partial" title="5 out of 7 forms covered">
206&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(when&nbsp;(interesting-location?&nbsp;gossip&nbsp;%)&nbsp;%)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
207&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location))]
</span><br/>
<span class="partial" title="5 out of 7 forms covered">
208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when-not&nbsp;(empty?&nbsp;l)&nbsp;l)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
209&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
210&nbsp;&nbsp;(defn&nbsp;learn-news-item
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
211&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;gossip&nbsp;like&nbsp;this&nbsp;`gossip`,&nbsp;which&nbsp;has&nbsp;learned&nbsp;this&nbsp;news&nbsp;`item`&nbsp;if
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
212&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;is&nbsp;of&nbsp;interest&nbsp;to&nbsp;them.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
213&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;Not&nbsp;yet&nbsp;implemented
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
214&nbsp;&nbsp;&nbsp;&nbsp;([gossip&nbsp;item]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(learn-news-item&nbsp;gossip&nbsp;item&nbsp;true))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
216&nbsp;&nbsp;&nbsp;&nbsp;([gossip&nbsp;item&nbsp;follow-inferences?]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
217&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
218&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interesting-item?&nbsp;gossip&nbsp;item)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
219&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[g&nbsp;(assoc&nbsp;gossip&nbsp;:knowledge
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
220&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assoc
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
222&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
223&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:nth-hand&nbsp;(if
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
224&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(number?&nbsp;(:nth-hand&nbsp;item))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
225&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(inc&nbsp;(:nth-hand&nbsp;item))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
226&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1)
</span><br/>
<span class="partial" title="8 out of 11 forms covered">
227&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:date&nbsp;(if&nbsp;(number?&nbsp;(:date&nbsp;item))&nbsp;(:date&nbsp;item)&nbsp;(now))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
228&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:location&nbsp;(degrade-location&nbsp;gossip&nbsp;(:location&nbsp;item))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;ought&nbsp;to&nbsp;degratde&nbsp;the&nbsp;location
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
230&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;ought&nbsp;to&nbsp;maybe-degrade&nbsp;characters&nbsp;we&#x27;re&nbsp;not&nbsp;yet&nbsp;interested&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
231&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
232&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;ought&nbsp;not&nbsp;to&nbsp;add&nbsp;knowledge&nbsp;items&nbsp;we&nbsp;already&nbsp;have,&nbsp;except
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
233&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;to&nbsp;replace&nbsp;if&nbsp;new&nbsp;item&nbsp;is&nbsp;of&nbsp;increased&nbsp;specificity
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:knowledge&nbsp;gossip)))]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
235&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;follow-inferences?
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assoc
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
237&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:knowledge
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
239&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(concat&nbsp;(:knowledge&nbsp;g)&nbsp;(make-all-inferences&nbsp;item)))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
241&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gossip)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
242&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
243&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
244&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -79,22 +79,22 @@
<span class="covered" title="3 out of 3 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;(:id&nbsp;c)
</span><br/>
<span class="partial" title="9 out of 10 forms covered">
<span class="covered" title="10 out of 10 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;(or&nbsp;(-&gt;&nbsp;c&nbsp;:prices&nbsp;commodity)&nbsp;0)
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d&nbsp;(or&nbsp;(-&gt;&nbsp;c&nbsp;:demands&nbsp;commodity)&nbsp;0)
</span><br/>
<span class="partial" title="9 out of 10 forms covered">
<span class="covered" title="10 out of 10 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;st&nbsp;(or&nbsp;(-&gt;&nbsp;c&nbsp;:stock&nbsp;commodity)&nbsp;0)
</span><br/>
<span class="partial" title="9 out of 10 forms covered">
<span class="covered" title="10 out of 10 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;su&nbsp;(or&nbsp;(-&gt;&nbsp;c&nbsp;:supplies&nbsp;commodity)&nbsp;0)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decrement&nbsp;(min&nbsp;st&nbsp;d)
</span><br/>
<span class="partial" title="3 out of 6 forms covered">
<span class="partial" title="5 out of 6 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;increment&nbsp;(cond
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
@ -190,46 +190,46 @@
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;([world]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
<span class="covered" title="2 out of 2 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
<span class="covered" title="1 out of 1 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
<span class="covered" title="1 out of 1 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
<span class="covered" title="3 out of 3 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
<span class="covered" title="4 out of 4 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(update-markets&nbsp;world&nbsp;%)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
<span class="covered" title="5 out of 5 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;(:cities&nbsp;world)))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;([world&nbsp;city]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
<span class="covered" title="2 out of 2 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
<span class="covered" title="1 out of 1 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
<span class="covered" title="1 out of 1 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{}
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
<span class="covered" title="8 out of 8 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(update-markets&nbsp;world&nbsp;city&nbsp;%)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
<span class="covered" title="5 out of 5 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;(:commodities&nbsp;world)))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;([world&nbsp;city&nbsp;commodity]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
<span class="covered" title="5 out of 5 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(adjust-quantity-and-price&nbsp;world&nbsp;city&nbsp;commodity)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
@ -250,7 +250,7 @@
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;[world]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
<span class="covered" title="3 out of 3 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;(update-markets&nbsp;world))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">

View file

@ -0,0 +1,440 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> the_great_game/time.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;the-great-game.time
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.string&nbsp;:as&nbsp;s]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
003&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
004&nbsp;&nbsp;(def&nbsp;game-start-time
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;start&nbsp;time&nbsp;of&nbsp;this&nbsp;run.&quot;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;(System&#x2F;currentTimeMillis))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
008&nbsp;&nbsp;(def&nbsp;^:const&nbsp;game-day-length
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;Java&nbsp;clock&nbsp;advances&nbsp;in&nbsp;milliseconds,&nbsp;which&nbsp;is&nbsp;fine.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;But&nbsp;we&nbsp;need&nbsp;game-days&nbsp;to&nbsp;be&nbsp;shorter&nbsp;than&nbsp;real&nbsp;world&nbsp;days.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;Witcher&nbsp;3&nbsp;game&nbsp;day&nbsp;is&nbsp;1&nbsp;hour&nbsp;36&nbsp;minutes,&nbsp;or&nbsp;96&nbsp;minutes,&nbsp;which&nbsp;is
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;presumably&nbsp;researched.&nbsp;Round&nbsp;it&nbsp;up&nbsp;to&nbsp;100&nbsp;minutes&nbsp;for&nbsp;easier
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;calculation.&quot;
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;(*&nbsp;100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;minutes&nbsp;per&nbsp;game&nbsp;day
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;60&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;seconds&nbsp;per&nbsp;minute
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1000))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;milliseconds&nbsp;per&nbsp;second
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
017&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
018&nbsp;&nbsp;(defn&nbsp;now
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&quot;For&nbsp;now,&nbsp;we&#x27;ll&nbsp;use&nbsp;Java&nbsp;timestamp&nbsp;for&nbsp;time;&nbsp;ultimately,&nbsp;we&nbsp;need&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;concept&nbsp;of&nbsp;game-time&nbsp;which&nbsp;allows&nbsp;us&nbsp;to&nbsp;drive&nbsp;day&#x2F;night&nbsp;cycle,&nbsp;seasons,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;et&nbsp;cetera,&nbsp;but&nbsp;what&nbsp;matters&nbsp;about&nbsp;time&nbsp;is&nbsp;that&nbsp;it&nbsp;is&nbsp;a&nbsp;value&nbsp;which
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;increases.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;(System&#x2F;currentTimeMillis))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
025&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
026&nbsp;&nbsp;(def&nbsp;^:const&nbsp;canonical-ordering-of-houses
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;canonical&nbsp;ordering&nbsp;of&nbsp;religious&nbsp;houses.&quot;
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;[:eye
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:foot
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:nose
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:hand
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ear
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:mouth
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stomach
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:furrow
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:plough])
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
037&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
038&nbsp;&nbsp;(def&nbsp;^:const&nbsp;days-of-week
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;eight-day&nbsp;week&nbsp;of&nbsp;the&nbsp;game&nbsp;world.&nbsp;This&nbsp;differs&nbsp;from&nbsp;the&nbsp;canonical
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;ordering&nbsp;of&nbsp;houses&nbsp;in&nbsp;that&nbsp;it&nbsp;omits&nbsp;the&nbsp;eye.&quot;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(rest&nbsp;canonical-ordering-of-houses))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;(def&nbsp;^:const&nbsp;days-in-week
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&quot;This&nbsp;world&nbsp;has&nbsp;an&nbsp;eight&nbsp;day&nbsp;week.&quot;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;(count&nbsp;days-of-week))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
047&nbsp;&nbsp;(def&nbsp;^:const&nbsp;seasons-of-year
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;ordering&nbsp;of&nbsp;seasons&nbsp;in&nbsp;the&nbsp;year&nbsp;is&nbsp;different&nbsp;from&nbsp;the&nbsp;canonical
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;ordering&nbsp;of&nbsp;the&nbsp;houses,&nbsp;for&nbsp;reasons&nbsp;of&nbsp;the&nbsp;agricultural&nbsp;cycle.&quot;
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;[:foot
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:nose
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:hand
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ear
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:mouth
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stomach
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:plough
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:furrow
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:eye])
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
059&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
060&nbsp;&nbsp;(def&nbsp;^:const&nbsp;seasons-in-year
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&quot;Nine&nbsp;seasons&nbsp;in&nbsp;a&nbsp;year,&nbsp;one&nbsp;for&nbsp;each&nbsp;house&nbsp;(although&nbsp;the&nbsp;order&nbsp;is
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;different.&quot;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;(count&nbsp;seasons-of-year))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
064&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
065&nbsp;&nbsp;(def&nbsp;^:const&nbsp;weeks-of-season
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&quot;To&nbsp;fit&nbsp;nine&nbsp;seasons&nbsp;of&nbsp;eight&nbsp;day&nbsp;weeks&nbsp;into&nbsp;365&nbsp;days,&nbsp;each&nbsp;must&nbsp;be&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;five&nbsp;weeks.&quot;
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;[:first&nbsp;:second&nbsp;:third&nbsp;:fourth&nbsp;:fifth])
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
069&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
070&nbsp;&nbsp;(def&nbsp;^:const&nbsp;weeks-in-season
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&quot;To&nbsp;fit&nbsp;nine&nbsp;seasons&nbsp;of&nbsp;eight&nbsp;day&nbsp;weeks&nbsp;into&nbsp;365&nbsp;days,&nbsp;each&nbsp;must&nbsp;be&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;five&nbsp;weeks.&quot;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;(count&nbsp;weeks-of-season))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
074&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
075&nbsp;&nbsp;(def&nbsp;^:const&nbsp;days-in-season
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;(*&nbsp;weeks-in-season&nbsp;days-in-week))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
077&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
078&nbsp;&nbsp;(defn&nbsp;game-time
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&quot;With&nbsp;no&nbsp;arguments,&nbsp;the&nbsp;current&nbsp;game&nbsp;time.&nbsp;If&nbsp;a&nbsp;Java&nbsp;`timestamp`&nbsp;value&nbsp;is
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;passed&nbsp;(as&nbsp;a&nbsp;`long`),&nbsp;the&nbsp;game&nbsp;time&nbsp;represented&nbsp;by&nbsp;that&nbsp;value.&quot;
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;([]&nbsp;(game-time&nbsp;(now)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;([timestamp]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&nbsp;timestamp&nbsp;game-start-time)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
084&nbsp;&nbsp;
</span><br/>
<span class="covered" title="63 out of 63 forms covered">
085&nbsp;&nbsp;(defmacro&nbsp;day-of-year
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;day&nbsp;of&nbsp;the&nbsp;year&nbsp;represented&nbsp;by&nbsp;this&nbsp;`game-time`,&nbsp;ignoring&nbsp;leap&nbsp;years.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;[game-time]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;`(mod&nbsp;(long&nbsp;(&#x2F;&nbsp;~game-time&nbsp;game-day-length))&nbsp;365))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
089&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
090&nbsp;&nbsp;(def&nbsp;waiting-day?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&quot;Does&nbsp;this&nbsp;`game-time`&nbsp;represent&nbsp;a&nbsp;waiting&nbsp;day?&quot;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;(memoize
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;we&#x27;re&nbsp;likely&nbsp;to&nbsp;call&nbsp;this&nbsp;several&nbsp;times&nbsp;in&nbsp;quick&nbsp;succession&nbsp;on&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;same&nbsp;timestamp
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[game-time]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&gt;=
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(day-of-year&nbsp;game-time)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*&nbsp;seasons-in-year&nbsp;weeks-in-season&nbsp;days-in-week)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
099&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
100&nbsp;&nbsp;(defn&nbsp;day
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&quot;Day&nbsp;of&nbsp;the&nbsp;eight-day&nbsp;week&nbsp;represented&nbsp;by&nbsp;this&nbsp;`game-time`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;[game-time]
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[day-of-week&nbsp;(mod&nbsp;(day-of-year&nbsp;game-time)&nbsp;days-in-week)]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(waiting-day?&nbsp;game-time)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth&nbsp;weeks-of-season&nbsp;day-of-week)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth&nbsp;days-of-week&nbsp;day-of-week))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
107&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
108&nbsp;&nbsp;(defn&nbsp;week
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;&quot;Week&nbsp;of&nbsp;season&nbsp;represented&nbsp;by&nbsp;this&nbsp;`game-time`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;[game-time]
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[day-of-season&nbsp;(mod&nbsp;(day-of-year&nbsp;game-time)&nbsp;days-in-season)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;week&nbsp;(&#x2F;&nbsp;day-of-season&nbsp;days-in-week)]
</span><br/>
<span class="partial" title="4 out of 5 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(waiting-day?&nbsp;game-time)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:waiting
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth&nbsp;weeks-of-season&nbsp;week))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
116&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
117&nbsp;&nbsp;(defn&nbsp;season
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;[game-time]
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[season&nbsp;(int&nbsp;(&#x2F;&nbsp;(day-of-year&nbsp;game-time)&nbsp;days-in-season))]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(waiting-day?&nbsp;game-time)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:waiting
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth&nbsp;seasons-of-year&nbsp;season))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
123&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
124&nbsp;&nbsp;(defn&nbsp;date-string
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;correctly&nbsp;formatted&nbsp;date&nbsp;for&nbsp;this&nbsp;`game-time`&nbsp;in&nbsp;the&nbsp;calendar&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;Great&nbsp;Place.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;[game-time]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;(s&#x2F;join
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;&quot;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(waiting-day?&nbsp;game-time)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(s&#x2F;capitalize
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(name
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;weeks-of-season
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(mod&nbsp;(day-of-year&nbsp;game-time)&nbsp;days-in-week))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;waiting&nbsp;day&quot;]
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(s&#x2F;capitalize&nbsp;(name&nbsp;(week&nbsp;game-time)))
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(s&#x2F;capitalize&nbsp;(name&nbsp;(day&nbsp;game-time)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;of&nbsp;the&quot;
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(s&#x2F;capitalize&nbsp;(name&nbsp;(season&nbsp;game-time)))])))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
142&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
143&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
144&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,119 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> the_great_game/world/location.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;the-great-game.world.location
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Functions&nbsp;dealing&nbsp;with&nbsp;location&nbsp;in&nbsp;the&nbsp;world.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.math.numeric-tower&nbsp;:refer&nbsp;[expt&nbsp;sqrt]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
004&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;A&nbsp;&#x27;location&#x27;&nbsp;value&nbsp;is&nbsp;a&nbsp;list&nbsp;comprising&nbsp;at&nbsp;most&nbsp;the&nbsp;x&#x2F;y&nbsp;coordinate&nbsp;location
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;and&nbsp;the&nbsp;ids&nbsp;of&nbsp;the&nbsp;settlement&nbsp;and&nbsp;region&nbsp;(possibly&nbsp;hierarchically)&nbsp;that&nbsp;contain
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;the&nbsp;location.&nbsp;If&nbsp;the&nbsp;x&#x2F;y&nbsp;is&nbsp;not&nbsp;local&nbsp;to&nbsp;the&nbsp;home&nbsp;of&nbsp;the&nbsp;receiving&nbsp;agent,&nbsp;they
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;won&#x27;t&nbsp;remember&nbsp;it&nbsp;and&nbsp;won&#x27;t&nbsp;pass&nbsp;it&nbsp;on;&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;ids&nbsp;are&nbsp;not&nbsp;interesting
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;So&nbsp;location&nbsp;information&nbsp;will&nbsp;degrade&nbsp;progressively&nbsp;as&nbsp;the&nbsp;item&nbsp;is&nbsp;passed&nbsp;along.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
010&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;It&nbsp;is&nbsp;assumed&nbsp;that&nbsp;the&nbsp;`:home`&nbsp;of&nbsp;a&nbsp;character&nbsp;is&nbsp;a&nbsp;location&nbsp;in&nbsp;this&nbsp;sense.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
012&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
013&nbsp;&nbsp;(defn&nbsp;get-coords
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;coordinates&nbsp;in&nbsp;the&nbsp;game&nbsp;world&nbsp;of&nbsp;`location`,&nbsp;which&nbsp;may&nbsp;be
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;A&nbsp;coordinate&nbsp;pair&nbsp;in&nbsp;the&nbsp;format&nbsp;{:x&nbsp;5&nbsp;:y&nbsp;32};
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;A&nbsp;location,&nbsp;as&nbsp;discussed&nbsp;above;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;Any&nbsp;other&nbsp;gameworld&nbsp;object,&nbsp;having&nbsp;a&nbsp;`:location`&nbsp;property&nbsp;whose&nbsp;value
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;one&nbsp;of&nbsp;the&nbsp;above.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;[location]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(empty?&nbsp;location)&nbsp;nil
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;location)
</span><br/>
<span class="partial" title="1 out of 3 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="partial" title="13 out of 14 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(number?&nbsp;(:x&nbsp;location))&nbsp;(number?&nbsp;(:y&nbsp;location)))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:location&nbsp;location)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:location&nbsp;location))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(get-coords&nbsp;(first&nbsp;(remove&nbsp;keyword?&nbsp;location)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
030&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
031&nbsp;&nbsp;(defn&nbsp;distance-between
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;[location-1&nbsp;location-2]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[c1&nbsp;(get-coords&nbsp;location-1)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c2&nbsp;(get-coords&nbsp;location-2)]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when
</span><br/>
<span class="partial" title="5 out of 6 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;c1&nbsp;c2)
</span><br/>
<span class="covered" title="26 out of 26 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sqrt&nbsp;(+&nbsp;(expt&nbsp;(-&nbsp;(:x&nbsp;c1)&nbsp;(:x&nbsp;c2))&nbsp;2)&nbsp;(expt&nbsp;(-&nbsp;(:y&nbsp;c1)&nbsp;(:y&nbsp;c2))&nbsp;2))))))
</span><br/>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

39
docs/codox/sandbox.html Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,3 +2,6 @@
"Anything in the game world with agency")
;; hierarchy of needs probably gets implemented here
;; I'm probably going to want to defprotocol stuff, to define the hierarchy
;; of things in the gameworld; either that or drop to Java, wich I'd rather not do.

View file

@ -1,6 +1,7 @@
(ns the-great-game.gossip.gossip
"Interchange of news events between gossip agents"
(:require [the-great-game.utils :refer [deep-merge]]))
(:require [the-great-game.utils :refer [deep-merge]]
[the-great-game.gossip.news-items :refer [learn-news-item]]))
;; Note that habitual travellers are all gossip agents; specifically, at this
;; stage, that means merchants. When merchants are moved we also need to

View file

@ -1,6 +1,7 @@
(ns the-great-game.gossip.news-items
"Categories of news events interesting to gossip agents"
(:require [clojure.math.numeric-tower :refer [expt sqrt]]))
(:require [the-great-game.world.location :refer [distance-between]]
[the-great-game.time :refer [now]]))
;; The ideas here are based on the essay 'The spread of knowledge in a large
;; game world', q.v.; they've advanced a little beyond that and will doubtless
@ -20,14 +21,26 @@
their `verbs`. The `keys` associated with each topic are the extra pieces
of information required to give context to a gossip item. Generally:
* `actor` is the id of the character who performed the action;
* `other` is the id of the character on whom the action was performed;
* `actor` is the id of the character who it is reported performed the
action;
* `other` is the id of the character on whom it is reported the action
was performed;
* `location` is the place at which the action was performed;
* `object` is an object (or possibly list of objects?) relevant to the action;
* `object` is an object (or possibly list of objects?) relevant to the
action;
* `price` is special to buy/sell, but of significant interest to merchants.
#### Notes:
##### Characters:
*TODO* but note that at most all the receiver can learn about a character
from a news item is what the giver knows about that character, degraded by
what the receiver finds interesting about them. If we just pass the id here,
then either the receiver knows everything in the database about the
character, or else the receiver knows nothing at all about the character.
Neither is desirable. Further thought needed.
##### Locations:
A 'location' value is a list comprising at most the x/y coordinate location
@ -62,6 +75,7 @@
:plot {:verb :plot :keys [:actor :other :object :location]}
;; Rapes are interesting.
:rape {:verb :rape :keys [:actor :other :location]
;; Should you also infer from rape that actor is male and adult?
:inferences [{:verb :attack}
{:verb :sex}
{:verb :sex :actor :other :other :actor}]}
@ -84,7 +98,9 @@
(defn interest-in-character
"Integer representation of how interesting this `character` is to this
`gossip`."
`gossip`.
*TODO:* this assumes that characters are passed as keywords, but, as
documented above, they probably have to be maps, to allow for degradation."
[gossip character]
(count
(concat
@ -97,99 +113,46 @@
[gossip character]
(> (interest-in-character gossip character) 0))
(defn get-coords
"Return the coordinates in the game world of `location`, which may be
1. A coordinate pair in the format {:x 5 :y 32};
2. A location, as discussed above;
3. Any other gameworld object, having a `:location` property whose value
is one of the above."
[location]
(cond
(empty? location) nil
(map? location)
(cond
(and (number? (:x location)) (number? (:y location)))
location
(:location location)
(:location location))
:else
(get-coords (first (remove keyword? location)))))
;; (get-coords {:x 5 :y 7})
;; (get-coords [{:x -4 :y 55} :auchencairn :galloway :scotland])
(defn distance-between
[location-1 location-2]
(let [c1 (get-coords location-1)
c2 (get-coords location-2)]
(if
(and c1 c2)
(sqrt (+ (expt (- (:x c1) (:x c2)) 2) (expt (- (:y c1) (:y c2)) 2))))))
;; (distance-between {:x 5 :y 5} {:x 2 :y 2})
;; (distance-between {:x 5 :y 5} {:x 2 :y 5})
;; (distance-between {:x 5 :y 5} [{:x -4 :y 55} :auchencairn :galloway :scotland])
;; (distance-between {:x 5 :y 5} [:auchencairn :galloway :scotland])
(defn interest-in-location
"Integer representation of how interesting this `location` is to this
`gossip`."
[gossip location]
(cond
(and (map? location) (number? (:x location)) (number? (:y location)))
(if-let [home (:home gossip)]
(let [d (distance-between location home)
i (/ 10000 d) ;; 10000 at metre scale is 10km; interest should
;;fall of with distance from home, but possibly on a log scale
]
(if (> i 1) i 0))
0)
(coll? location)
(reduce
+
(map
#(interest-in-location gossip %)
location))
(and (map? location) (:x location) (:y location))
(if-let [home (:home gossip)]
(let [d (distance-between location home)
i (/ 10000 d) ;; 10000 at metre scale is 10km; interest should
;;fall of with distance from home, but possibly on a log scale
]
(if (i > 1) i 0)
i))
:else
(count
(filter
#(some (fn [x] (= x location)) (:location %))
(:knowledge gossip)))))
;; (interest-in-location
;; {:knowledge [{:verb :steal
;; :actor :albert
;; :other :belinda
;; :object :foo
;; :location [{:x 35 :y 23} :auchencairn :galloway]}]}
;; :galloway)
;; (interest-in-location
;; {:knowledge [{:verb :steal
;; :actor :albert
;; :other :belinda
;; :object :foo
;; :location [{:x 35 :y 23} :auchencairn :galloway]}]}
;; [:galloway :scotland])
;; (interest-in-location
;; {:knowledge [{:verb :steal
;; :actor :albert
;; :other :belinda
;; :object :foo
;; :location [{:x 35 :y 23} :auchencairn :galloway]}]}
;; :dumfries)
;; (interest-in-location
;; {:home {:x 35 :y 23}}
;; {:x 35 :y 24})
(defn interesting-location?
"True if the location of this news `item` is interesting to this `gossip`."
[gossip item]
(> (interest-in-location gossip (:location item)) 1))
(defn interesting-object?
[gossip object]
;; TODO: Not yet (really) implemented
true)
(defn interesting-topic?
[gossip topic]
;; TODO: Not yet (really) implemented
true)
(defn interesting-item?
"True if anything about this news `item` is interesting to this `gossip`."
[gossip item]
@ -212,18 +175,44 @@
#(= % :verb)
(keys rule))))))
;; (infer {:verb :marry :actor :adam :other :belinda}
;; {:verb :marry :actor :other :other :actor})
;; (infer {:verb :rape :actor :adam :other :belinda}
;; {:verb :attack})
;; (infer {:verb :rape :actor :adam :other :belinda}
;; {:verb :sex :actor :other :other :actor})
(declare learn-news-item)
(defn make-all-inferences
"Return a list of knowledge entries inferred from this news `item` by this
`gossip`."
[item]
(set
(reduce
concat
(map
#(:knowledge (learn-news-item {} (infer item %) false))
(:inferences (news-topics (:verb item)))))))
(defn degrade-character
"Return a character specification like this `character`, but comprising
only those properties this `gossip` is interested in."
[gossip character]
;; TODO: Not yet (really) implemented
character)
(defn degrade-location
"Return a location specification like this `location`, but comprising
only those elements this `gossip` is interested in. If none, return
`nil`."
[gossip location]
(let [l (if
(coll? location)
(filter
#(when (interesting-location? gossip %) %)
location))]
(when-not (empty? l) l)))
(defn learn-news-item
"Return a gossip like this `gossip`, which has learned this news `item` if
it is of interest to them."
;; TODO: Not yet implemented
([gossip item]
(learn-news-item gossip item false))
(learn-news-item gossip item true))
([gossip item follow-inferences?]
(if
(interesting-item? gossip item)
@ -235,17 +224,21 @@
(number? (:nth-hand item))
(inc (:nth-hand item))
1)
;; ought to degrate the location
:date (if (number? (:date item)) (:date item) (now))
:location (degrade-location gossip (:location item))
;; ought to degratde the location
;; ought to maybe-degrade characters we're not yet interested in
)
;; ought not to add knowledge items we already have, except
;; to replace if new item is of increased specificity
(:knowledge gossip)))]
(if follow-inferences?
(reduce
merge
(assoc
g
(map
#(learn-news-item gossip (infer item %) false)
(:inferences (news-topics (:verb item))))))))))
:knowledge
(concat (:knowledge g) (make-all-inferences item)))
g))
gossip)))

144
src/the_great_game/time.clj Normal file
View file

@ -0,0 +1,144 @@
(ns the-great-game.time
(:require [clojure.string :as s]))
(def game-start-time
"The start time of this run."
(System/currentTimeMillis))
(def ^:const game-day-length
"The Java clock advances in milliseconds, which is fine.
But we need game-days to be shorter than real world days.
A Witcher 3 game day is 1 hour 36 minutes, or 96 minutes, which is
presumably researched. Round it up to 100 minutes for easier
calculation."
(* 100 ;; minutes per game day
60 ;; seconds per minute
1000)) ;; milliseconds per second
(defn now
"For now, we'll use Java timestamp for time; ultimately, we need a
concept of game-time which allows us to drive day/night cycle, seasons,
et cetera, but what matters about time is that it is a value which
increases."
[]
(System/currentTimeMillis))
(def ^:const canonical-ordering-of-houses
"The canonical ordering of religious houses."
[:eye
:foot
:nose
:hand
:ear
:mouth
:stomach
:furrow
:plough])
(def ^:const days-of-week
"The eight-day week of the game world. This differs from the canonical
ordering of houses in that it omits the eye."
(rest canonical-ordering-of-houses))
(def ^:const days-in-week
"This world has an eight day week."
(count days-of-week))
(def ^:const seasons-of-year
"The ordering of seasons in the year is different from the canonical
ordering of the houses, for reasons of the agricultural cycle."
[:foot
:nose
:hand
:ear
:mouth
:stomach
:plough
:furrow
:eye])
(def ^:const seasons-in-year
"Nine seasons in a year, one for each house (although the order is
different."
(count seasons-of-year))
(def ^:const weeks-of-season
"To fit nine seasons of eight day weeks into 365 days, each must be of
five weeks."
[:first :second :third :fourth :fifth])
(def ^:const weeks-in-season
"To fit nine seasons of eight day weeks into 365 days, each must be of
five weeks."
(count weeks-of-season))
(def ^:const days-in-season
(* weeks-in-season days-in-week))
(defn game-time
"With no arguments, the current game time. If a Java `timestamp` value is
passed (as a `long`), the game time represented by that value."
([] (game-time (now)))
([timestamp]
(- timestamp game-start-time)))
(defmacro day-of-year
"The day of the year represented by this `game-time`, ignoring leap years."
[game-time]
`(mod (long (/ ~game-time game-day-length)) 365))
(def waiting-day?
"Does this `game-time` represent a waiting day?"
(memoize
;; we're likely to call this several times in quick succession on the
;; same timestamp
(fn [game-time]
(>=
(day-of-year game-time)
(* seasons-in-year weeks-in-season days-in-week)))))
(defn day
"Day of the eight-day week represented by this `game-time`."
[game-time]
(let [day-of-week (mod (day-of-year game-time) days-in-week)]
(if (waiting-day? game-time)
(nth weeks-of-season day-of-week)
(nth days-of-week day-of-week))))
(defn week
"Week of season represented by this `game-time`."
[game-time]
(let [day-of-season (mod (day-of-year game-time) days-in-season)
week (/ day-of-season days-in-week)]
(if (waiting-day? game-time)
:waiting
(nth weeks-of-season week))))
(defn season
[game-time]
(let [season (int (/ (day-of-year game-time) days-in-season))]
(if (waiting-day? game-time)
:waiting
(nth seasons-of-year season))))
(defn date-string
"Return a correctly formatted date for this `game-time` in the calendar of
the Great Place."
[game-time]
(s/join
" "
(if
(waiting-day? game-time)
[(s/capitalize
(name
(nth
weeks-of-season
(mod (day-of-year game-time) days-in-week))))
"waiting day"]
[(s/capitalize (name (week game-time)))
(s/capitalize (name (day game-time)))
"of the"
(s/capitalize (name (season game-time)))])))

View file

@ -1,5 +1,6 @@
(ns the-great-game.world.location
"Functions dealing with location in the world.")
"Functions dealing with location in the world."
(:require [clojure.math.numeric-tower :refer [expt sqrt]]))
;; A 'location' value is a list comprising at most the x/y coordinate location
;; and the ids of the settlement and region (possibly hierarchically) that contain
@ -8,3 +9,29 @@
;; So location information will degrade progressively as the item is passed along.
;; It is assumed that the `:home` of a character is a location in this sense.
(defn get-coords
"Return the coordinates in the game world of `location`, which may be
1. A coordinate pair in the format {:x 5 :y 32};
2. A location, as discussed above;
3. Any other gameworld object, having a `:location` property whose value
is one of the above."
[location]
(cond
(empty? location) nil
(map? location)
(cond
(and (number? (:x location)) (number? (:y location)))
location
(:location location)
(:location location))
:else
(get-coords (first (remove keyword? location)))))
(defn distance-between
[location-1 location-2]
(let [c1 (get-coords location-1)
c2 (get-coords location-2)]
(when
(and c1 c2)
(sqrt (+ (expt (- (:x c1) (:x c2)) 2) (expt (- (:y c1) (:y c2)) 2))))))

View file

@ -0,0 +1,4 @@
(ns the-great-game.gossip.gossip-test
(:require [clojure.test :refer :all]
[the-great-game.gossip.gossip :refer :all]))

View file

@ -0,0 +1,132 @@
(ns the-great-game.gossip.news-items-test
(:require [clojure.test :refer :all]
[the-great-game.gossip.news-items :refer :all]))
(deftest location-test
(testing "Interest in locations"
(let [expected 1
actual (interest-in-location
{:knowledge [{:verb :steal
:actor :albert
:other :belinda
:object :foo
:location [{:x 35 :y 23} :auchencairn :galloway]}]}
:galloway)]
(is (= actual expected)))
(let [expected 2
actual (interest-in-location
{:knowledge [{:verb :steal
:actor :albert
:other :belinda
:object :foo
:location [{:x 35 :y 23} :auchencairn :galloway :scotland]}]}
[:galloway :scotland])]
(is (= actual expected)))
(let [expected 0
actual (interest-in-location
{:knowledge [{:verb :steal
:actor :albert
:other :belinda
:object :foo
:location [{:x 35 :y 23} :auchencairn :galloway]}]}
[:dumfries])]
(is (= actual expected)))
(let [expected 7071.067811865475
actual (interest-in-location
{:home [{:x 35 :y 23}]}
[{:x 34 :y 24}])]
(is (= actual expected)
"TODO: 7071.067811865475 is actually a bad answer."))
(let [expected 0
actual (interest-in-location
{:home [{:x 35 :y 23}]}
[{:x 34 :y 24000}])]
(is (= actual expected)
"Too far apart (> 10000)."))
(let [expected true
actual (interesting-location?
{:knowledge [{:verb :steal
:actor :albert
:other :belinda
:object :foo
:location [{:x 35 :y 23} :auchencairn :galloway]}]}
:galloway)]
(is (= actual expected)))
(let [expected true
actual (interesting-location?
{:knowledge [{:verb :steal
:actor :albert
:other :belinda
:object :foo
:location [{:x 35 :y 23} :auchencairn :galloway]}]}
[:galloway :scotland])]
(is (= actual expected)))
(let [expected false
actual (interesting-location?
{:knowledge [{:verb :steal
:actor :albert
:other :belinda
:object :foo
:location [{:x 35 :y 23} :auchencairn :galloway]}]}
[:dumfries])]
(is (= actual expected)))
(let [expected true
actual (interesting-location?
{:home [{:x 35 :y 23}]}
[{:x 34 :y 24}])]
(is (= actual expected)))
(let [expected false
actual (interesting-location?
{:home [{:x 35 :y 23}]}
[{:x 34 :y 240000}])]
(is (= actual expected))))
(testing "Degrading locations"
(let [expected [:galloway]
actual (degrade-location
{:home [{0 0} :test-home :galloway]}
[{-4 55} :auchencairn :galloway])]
(is (= actual expected)))
(let [expected nil
actual (degrade-location
{:home [{0 0} :test-home :galloway]}
[:froboz])]
(is (= actual expected)))))
(deftest inference-tests
(testing "Ability to infer new knowledge from news items: single rule tests"
(let [expected {:verb :marry, :actor :belinda, :other :adam}
actual (infer {:verb :marry :actor :adam :other :belinda}
{:verb :marry :actor :other :other :actor})]
(is (= actual expected)))
(let [expected {:verb :attack, :actor :adam, :other :belinda}
actual (infer {:verb :rape :actor :adam :other :belinda}
{:verb :attack})]
(is (= actual expected)))
(let [expected {:verb :sex, :actor :belinda, :other :adam}
actual (infer {:verb :rape :actor :adam :other :belinda}
{:verb :sex :actor :other :other :actor})]
(is (= actual expected))))
(testing "Ability to infer new knowledge from news items: all applicable rules"
(let [expected #{{:verb :sex, :actor :belinda, :other :adam, :location nil, :nth-hand 1}
{:verb :sex, :actor :adam, :other :belinda, :location nil, :nth-hand 1}
{:verb :attack, :actor :adam, :other :belinda, :location nil, :nth-hand 1}}
;; dates will not be and cannot be expected to be equal
actual (make-all-inferences
{:verb :rape :actor :adam :other :belinda :location :test-home})
actual' (map #(dissoc % :date) actual)]
(is (= actual' expected)))))
;; (deftest learn-tests
;; (testing "Learning from an interesting news item."
;; (let [expected {:home [{0 0} :test-home],
;; :knowledge ({:verb :rape, :actor :adam, :other :belinda, :location nil, :nth-hand 1}
;; {:verb :sex, :actor :belinda, :other :adam, :location nil, :nth-hand 1}
;; {:verb :attack, :actor :adam, :other :belinda, :location nil, :nth-hand 1}
;; {:verb :sex, :actor :adam, :other :belinda, :location nil, :nth-hand 1})}
;; actual (learn-news-item
;; {:home [{0, 0} :test-home]
;; :knowledge []}
;; {:verb :rape :actor :adam :other :belinda :location [:test-home]})
;; actual' (assoc actual :knowledge (map #(dissoc % :date) (:knowledge actual)))]
;; (is (= actual' expected)))))

View file

@ -0,0 +1,79 @@
(ns the-great-game.time-test
(:require [clojure.test :refer :all]
;; [clojure.core.async :refer [thread <!]]
[the-great-game.time :refer :all]))
(deftest now-tests
(testing "Time progresses"
(let [t1 (now)]
(is (> t1 game-start-time))
(Thread/sleep 1000)
(is (> (now) t1)))))
(deftest game-time-tests
(testing "Getting game-time"
(is (= (game-time (inc game-start-time)) 1))))
(deftest calendar-tests
(testing "In-game calendar functions"
(let [expected :foot
actual (day 0)]
(is (= actual expected)))
(let [expected :stomach
actual (day (* 5 game-day-length))]
(is (= actual expected)))
(let [expected :foot
actual (day (* days-in-week game-day-length))]
(is (= actual expected)))
(let [expected :first ;; waiting day
actual (day (* 360 game-day-length))]
(is (= actual expected)))
(let [expected :first
actual (week 0)]
(is (= actual expected)))
(let [expected :second
actual (week (* days-in-week game-day-length))]
(is (= actual expected)))
(let [expected :first
actual (week (* days-in-season game-day-length))]
(is (= actual expected)))
(let [expected :foot
actual (season 0)]
(is (= actual expected)))
(let [expected :mouth
actual (season (* 180 game-day-length))]
(is (= actual expected)))
(let [expected :eye
actual (season (* 359 game-day-length))]
(is (= actual expected)))
(let [expected :waiting
actual (season (* 360 game-day-length))]
(is (= actual expected)))
(let [expected :foot
actual (season (* 365 game-day-length))]
(is (= actual expected)))))
(deftest date-string-tests
(testing "Date-string formatting"
(let [expected "First Foot of the Foot"
actual (date-string 0)]
(is (= actual expected)))
(let [expected "First Foot of the Nose"
actual (date-string
(* days-in-season game-day-length))]
(is (= actual expected)))
(let [expected "Third Mouth of the Mouth"
actual (date-string (* 180 game-day-length))]
(is (= actual expected)))
(let [expected "Fifth Plough of the Eye"
actual (date-string (* 359 game-day-length))]
(is (= actual expected)))
(let [expected "First waiting day"
actual (date-string (* 360 game-day-length))]
(is (= actual expected)))
(let [expected "First Foot of the Foot"
actual (date-string (* 365 game-day-length))]
(is (= actual expected)))))

View file

@ -0,0 +1,36 @@
(ns the-great-game.world.location-test
(:require [clojure.test :refer :all]
[the-great-game.world.location :refer :all]))
(deftest get-coords-test
(testing "Get coordinates of location"
(let [expected {:x 5 :y 7}
actual (get-coords {:x 5 :y 7})]
(is (= actual expected)))
(let [expected {:x -4 :y 55}
actual (get-coords [{:x -4 :y 55} :auchencairn :galloway :scotland])]
(is (= actual expected)))
(let [expected nil
actual (get-coords [:auchencairn :galloway :scotland])]
(is (= actual expected)))
))
(deftest distance-test
(testing "Distance between two locations"
(let [expected 4.242640687119285
actual (distance-between {:x 5 :y 5} {:x 2 :y 2})]
(is (= actual expected)))
(let [expected 3
actual (distance-between {:x 5 :y 5} {:x 2 :y 5})]
(is (= actual expected)))
(let [expected 50.80354318352215
actual (distance-between
{:x 5 :y 5}
[{:x -4 :y 55} :auchencairn :galloway :scotland])]
(is (= actual expected)))
(let [expected nil
actual (distance-between
{:x 5 :y 5}
[:auchencairn :galloway :scotland])]
(is (= actual expected)))
))