Merge branch 'develop'

This commit is contained in:
Simon Brooke 2024-04-04 13:22:23 +01:00
commit dcf79bca7a
201 changed files with 13845 additions and 1642 deletions

View file

@ -0,0 +1 @@
^:replace {:linters {}}

34
.gitignore vendored
View file

@ -18,11 +18,39 @@ pom.xml.asc
.lein-failures
.nrepl-port
.cpcache/
.calva/
.idea/
*~
.calva/output-window/output.calva-repl
.settings/
.classpath
.project
.lsp/sqlite.db
libbulletjme.so
liblwjgl64.so
libopenal64.so
.settings/
.classpath
.project
.calva/
.lsp/
*.so
docs/cloverage/codecov.json
docs/cloverage/coverage.xml
src/cc/journeyman/the_great_game/cloverage.clj
.DS_Store
.portal/

491
LICENSE
View file

@ -1,214 +1,361 @@
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
### GNU GENERAL PUBLIC LICENSE
1. DEFINITIONS
Version 2, June 1991
"Contribution" means:
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
a) in the case of the initial Contributor, the initial code and
documentation distributed under this Agreement, and
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
b) in the case of each subsequent Contributor:
### Preamble
i) changes to the Program, and
The licenses for most software are designed to take away your freedom
to share and change it. By contrast, the GNU General Public License is
intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
ii) additions to the Program;
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
where such changes and/or additions to the Program originate from and are
distributed by that particular Contributor. A Contribution 'originates' from
a Contributor if it was added to the Program by such Contributor itself or
anyone acting on such Contributor's behalf. Contributions do not include
additions to the Program which: (i) are separate modules of software
distributed in conjunction with the Program under their own license
agreement, and (ii) are not derivative works of the Program.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the software, or if you modify it.
"Contributor" means any person or entity that distributes the Program.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
"Licensed Patents" mean patent claims licensable by a Contributor which are
necessarily infringed by the use or sale of its Contribution alone or when
combined with the Program.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
"Program" means the Contributions distributed in accordance with this
Agreement.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on,
we want its recipients to know that what they have is not the
original, so that any problems introduced by others will not reflect
on the original authors' reputations.
"Recipient" means anyone who receives the Program under this Agreement,
including all Contributors.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at
all.
2. GRANT OF RIGHTS
The precise terms and conditions for copying, distribution and
modification follow.
a) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free copyright license to
reproduce, prepare derivative works of, publicly display, publicly perform,
distribute and sublicense the Contribution of such Contributor, if any, and
such derivative works, in source code and object code form.
### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
b) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free patent license under
Licensed Patents to make, use, sell, offer to sell, import and otherwise
transfer the Contribution of such Contributor, if any, in source code and
object code form. This patent license shall apply to the combination of the
Contribution and the Program if, at the time the Contribution is added by the
Contributor, such addition of the Contribution causes such combination to be
covered by the Licensed Patents. The patent license shall not apply to any
other combinations which include the Contribution. No hardware per se is
licensed hereunder.
**0.** This License applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work
based on the Program" means either the Program or any derivative work
under copyright law: that is to say, a work containing the Program or
a portion of it, either verbatim or with modifications and/or
translated into another language. (Hereinafter, translation is
included without limitation in the term "modification".) Each licensee
is addressed as "you".
c) Recipient understands that although each Contributor grants the licenses
to its Contributions set forth herein, no assurances are provided by any
Contributor that the Program does not infringe the patent or other
intellectual property rights of any other entity. Each Contributor disclaims
any liability to Recipient for claims brought by any other entity based on
infringement of intellectual property rights or otherwise. As a condition to
exercising the rights and licenses granted hereunder, each Recipient hereby
assumes sole responsibility to secure any other intellectual property rights
needed, if any. For example, if a third party patent license is required to
allow Recipient to distribute the Program, it is Recipient's responsibility
to acquire that license before distributing the Program.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the Program
(independent of having been made by running the Program). Whether that
is true depends on what the Program does.
d) Each Contributor represents that to its knowledge it has sufficient
copyright rights in its Contribution, if any, to grant the copyright license
set forth in this Agreement.
**1.** You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
3. REQUIREMENTS
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a
fee.
A Contributor may choose to distribute the Program in object code form under
its own license agreement, provided that:
**2.** You may modify your copy or copies of the Program or any
portion of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
**a)** You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
i) effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title
and non-infringement, and implied warranties or conditions of merchantability
and fitness for a particular purpose;
ii) effectively excludes on behalf of all Contributors all liability for
damages, including direct, indirect, special, incidental and consequential
damages, such as lost profits;
**b)** You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any part
thereof, to be licensed as a whole at no charge to all third parties
under the terms of this License.
iii) states that any provisions which differ from this Agreement are offered
by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a reasonable manner on
or through a medium customarily used for software exchange.
**c)** If the modified program normally reads commands interactively
when run, you must cause it, when started running for such interactive
use in the most ordinary way, to print or display an announcement
including an appropriate copyright notice and a notice that there is
no warranty (or else, saying that you provide a warranty) and that
users may redistribute the program under these conditions, and telling
the user how to view a copy of this License. (Exception: if the
Program itself is interactive but does not normally print such an
announcement, your work based on the Program is not required to print
an announcement.)
When the Program is made available in source code form:
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
a) it must be made available under this Agreement; and
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
b) a copy of this Agreement must be included with each copy of the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
Contributors may not remove or alter any copyright notices contained within
the Program.
**3.** You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
Each Contributor must identify itself as the originator of its Contribution,
if any, in a manner that reasonably allows subsequent Recipients to identify
the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
**a)** Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections 1
and 2 above on a medium customarily used for software interchange; or,
Commercial distributors of software may accept certain responsibilities with
respect to end users, business partners and the like. While this license is
intended to facilitate the commercial use of the Program, the Contributor who
includes the Program in a commercial product offering should do so in a
manner which does not create potential liability for other Contributors.
Therefore, if a Contributor includes the Program in a commercial product
offering, such Contributor ("Commercial Contributor") hereby agrees to defend
and indemnify every other Contributor ("Indemnified Contributor") against any
losses, damages and costs (collectively "Losses") arising from claims,
lawsuits and other legal actions brought by a third party against the
Indemnified Contributor to the extent caused by the acts or omissions of such
Commercial Contributor in connection with its distribution of the Program in
a commercial product offering. The obligations in this section do not apply
to any claims or Losses relating to any actual or alleged intellectual
property infringement. In order to qualify, an Indemnified Contributor must:
a) promptly notify the Commercial Contributor in writing of such claim, and
b) allow the Commercial Contributor to control, and cooperate with the
Commercial Contributor in, the defense and any related settlement
negotiations. The Indemnified Contributor may participate in any such claim
at its own expense.
For example, a Contributor might include the Program in a commercial product
offering, Product X. That Contributor is then a Commercial Contributor. If
that Commercial Contributor then makes performance claims, or offers
warranties related to Product X, those performance claims and warranties are
such Commercial Contributor's responsibility alone. Under this section, the
Commercial Contributor would have to defend claims against the other
Contributors related to those performance claims and warranties, and if a
court requires any other Contributor to pay any damages as a result, the
Commercial Contributor must pay those damages.
**b)** Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your cost of
physically performing source distribution, a complete machine-readable
copy of the corresponding source code, to be distributed under the
terms of Sections 1 and 2 above on a medium customarily used for
software interchange; or,
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON
AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the
appropriateness of using and distributing the Program and assumes all risks
associated with its exercise of rights under this Agreement , including but
not limited to the risks and costs of program errors, compliance with
applicable laws, damage to or loss of data, programs or equipment, and
unavailability or interruption of operations.
**c)** Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is allowed
only for noncommercial distribution and only if you received the
program in object code or executable form with such an offer, in
accord with Subsection b above.)
6. DISCLAIMER OF LIABILITY
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
7. GENERAL
**4.** You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt otherwise
to copy, modify, sublicense or distribute the Program is void, and
will automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of the
remainder of the terms of this Agreement, and without further action by the
parties hereto, such provision shall be reformed to the minimum extent
necessary to make such provision valid and enforceable.
**5.** You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
If Recipient institutes patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Program itself
(excluding combinations of the Program with other software or hardware)
infringes such Recipient's patent(s), then such Recipient's rights granted
under Section 2(b) shall terminate as of the date such litigation is filed.
**6.** Each time you redistribute the Program (or any work based on
the Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
All Recipient's rights under this Agreement shall terminate if it fails to
comply with any of the material terms or conditions of this Agreement and
does not cure such failure in a reasonable period of time after becoming
aware of such noncompliance. If all Recipient's rights under this Agreement
terminate, Recipient agrees to cease use and distribution of the Program as
soon as reasonably practicable. However, Recipient's obligations under this
Agreement and any licenses granted by Recipient relating to the Program shall
continue and survive.
**7.** If, as a consequence of a court judgment or allegation of
patent infringement or for any other reason (not limited to patent
issues), conditions are imposed on you (whether by court order,
agreement or otherwise) that contradict the conditions of this
License, they do not excuse you from the conditions of this License.
If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations,
then as a consequence you may not distribute the Program at all. For
example, if a patent license would not permit royalty-free
redistribution of the Program by all those who receive copies directly
or indirectly through you, then the only way you could satisfy both it
and this License would be to refrain entirely from distribution of the
Program.
Everyone is permitted to copy and distribute copies of this Agreement, but in
order to avoid inconsistency the Agreement is copyrighted and may only be
modified in the following manner. The Agreement Steward reserves the right to
publish new versions (including revisions) of this Agreement from time to
time. No one other than the Agreement Steward has the right to modify this
Agreement. The Eclipse Foundation is the initial Agreement Steward. The
Eclipse Foundation may assign the responsibility to serve as the Agreement
Steward to a suitable separate entity. Each new version of the Agreement will
be given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the
Agreement under which it was received. In addition, after a new version of
the Agreement is published, Contributor may elect to distribute the Program
(including its Contributions) under the new version. Except as expressly
stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
licenses to the intellectual property of any Contributor under this
Agreement, whether expressly, by implication, estoppel or otherwise. All
rights in the Program not expressly granted under this Agreement are
reserved.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
This Agreement is governed by the laws of the State of New York and the
intellectual property laws of the United States of America. No party to this
Agreement will bring a legal action under this Agreement more than one year
after the cause of action arose. Each party waives its rights to a jury trial
in any resulting litigation.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
**8.** If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
**9.** The Free Software Foundation may publish revised and/or new
versions of the General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Program does not specify a
version number of this License, you may choose any version ever
published by the Free Software Foundation.
**10.** If you wish to incorporate parts of the Program into other
free programs whose distribution conditions are different, write to
the author to ask for permission. For software which is copyrighted by
the Free Software Foundation, write to the Free Software Foundation;
we sometimes make exceptions for this. Our decision will be guided by
the two goals of preserving the free status of all derivatives of our
free software and of promoting the sharing and reuse of software
generally.
**NO WARRANTY**
**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
### END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does.
Copyright (C) yyyy name of author
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper
mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
The hypothetical commands \`show w' and \`show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than \`show w' and
\`show c'; they could even be mouse-clicks or menu items--whatever
suits your program.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the program,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written
by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library,
you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use the
[GNU Lesser General Public
License](https://www.gnu.org/licenses/lgpl.html) instead of this
License.

View file

@ -3,11 +3,9 @@ Prototype code towards the great game I've been writing about for ten years, and
## Awful warning
This doesn't work and isn't ever likely to fully work: it's way too ambitious for any
single person to actually build. Feel free to mine it for algorithms and ideas, but
don't expect a game you can actually play any time soon.
This doesn't work and isn't ever likely to fully work: it's way too ambitious for any single person to actually build. Feel free to mine it for algorithms and ideas, but don't expect a game you can actually play any time soon.
## There is documentation
## There is (masses of) documentation
[here](https://simon-brooke.github.io/the-great-game/)

View file

@ -0,0 +1,86 @@
# A Generic Planning Algorithm for craftworker NPCs
## Preamble
The Great Game requires a number of different crafts to be performed, both because the economy depends on the products of those crafts and to provide verisimilitude and set dressing. Some of those crafts, the relations between them, and the progression within them are set out in [Populating a game world](Populating-a-game-world.html).
For the purposes of planning work, only Master craftspeople are considered.
A Master craftsperson has
1. a house and appropriate workshop, within a settlement;
2. zero or more apprentices;
3. zero or more journeyman;
4. a spouse, who is usually of lower status;
5. zero of more coresident children;
6. zero or more coresident non-working parents/elders.
There are limits to the number of apprentices and journeymen a master may take on, essentially based on demand in the local market. The master is responsible for housing and feeding all of the household including apprentices and journeymen, and for obtaining sufficient craft supplies. All craft work done in the household belongs to the master.
Apprentices are definitely not paid. Journeymen should be paid, but this is a detail to ignore until we have other things working.
Journeymen will move on from master to master from time to time — infrequently, but it will happen; and may be dismissed by masters when markets are tight. Journeymen probably learn their craft recipes — which is to say, the items and qualities of item they are able to craft — from the masters they work with. Consequently, journeymen will seek out masters with higher reputation; masters will prefer journeymen with more experience.
Apprentices do not move on until the end of their period of apprenticeship (16th birthday?) when they become journeymen.
The master will plan work in four hour sessions - essentially, a morning session and an afternoon session each day.
All craftspeople have regular schedules covering mealtimes, sleep, and festivals. A lower status person within the household will have regular schedules covering each of fetching water, fetching fuel wood, taking out night soil, feeding chickens, washing dishes and laundry, and so on.
When the master works in the workshop, all the apprentices and journeymen will also work in the workshop; when the master is engaging in recreation, they're also engaging in recreation. What they do when the master is e.g. going to market, I haven't yet decided.
## Commodity items and special commissions
In principle all craftspeople may make both commodity items and special commission items, but in practice many crafts will be mostly commodity and a few will be almost entirely special commission (for example a diplomat doesn't produce peace treaties prèt-à-porter); but I don't yet have a good model of how I'm going to handle special commissions, so I'm just doing some hand waving here to say they will exist and must be handled.
## The algorithm
A master craftsperson needs to keep stock of a number of things
1. Sufficient food for the household;
2. Sufficient craft materials for immediate production;
3. Sufficient funds to buy more food/craft materials when needed;
4. Commodity craft items produced;
5. Craft items work in progress.
### Choosing tasks
So in planning a period of work, the master has to decide:
1. Do I need to go to market?
1. Is there news of a travelling merchant who buys what I produce arriving at my nearest market? -> go to market;
2. Is the household running low on food? -> go to market;
3. Is the household running low on craft materials? -> go to market;
2. Do I have any commissioned items to produce? -> produce commissioned items;
3. Should I work on commodities or take the day off?
This is a throw-of-the-dice decision, influenced by
1. Cash on hand (if there's little, greater incentive to work);
2. Weather (if it's especially good, less incentive to work);
3. Gossip (if there's interesting news, less incentive to work)
### Commodity production
If the decision is to work on commodities, the next decision is what commodity item to produce.
For each craft recipe the master knows there will be
1. A list of quantities of different craft materials needed per item, for example a sword might need two kilograms of steel of a particular quality, ten kilograms of charcoal, one kilogram of timber, half a square metre of leather;
2. An amount of craftsperson time - for example, a standard infantry sword might take ten hours;
3. Memory of prices achieved by item to that recipe in the local market.
The master will choose a recipe for which there are sufficient materials on hand, and which is profitable to make — the more profitable, the more likely to be selected (but I think there's probably some furtive dice rolling under the table here too; you don't want all the smiths in town producing infantry swords at the same time, because that would swamp the market and drive prices down).
When an item is started, the materials for it are removed from stock and assigned to the item, which is added to the work in progress list. The number of items that can be produced in a work session is
```clojure
(/ (* hours-in-session people-in-team)
hours-to-produce-one-item)
```
At the end of the session, the integer number of items produced is removed from the work in progress queue and added to stock, and the modulus is added as `:work-done` to the remaining item, which is left in the work in progress queue.
Obviously items in the work in progress queue may need to be completed at the start of the next commodity work session.
Obviously, none planned at sufficient granularity to be animated unless the workplace is in the `:active` circle, and none of it gets actually animated unless it's actually on camera, but the book-keeping in terms of food and craft materials consumed and of items produced must be done.
This implies that at least many master craftspeople must be in the `:background` circle, i.e. woken up once every game day to plan a work session, no matter how far away the player character is.

33
doc/API_Spec.md Normal file
View file

@ -0,0 +1,33 @@
# API Spec (unfinished)
If the Gossip system is ever to be deployed in practice at all, it will need to be deployed as a library add-on to someone else's game, since in practice The Great Game will never be even nearly finished. The game engine already knows many of the things the Gossip system needs to know; that we need to define is an interface which allows Gossip, considered as a subsystem, to query the game engine.
My preference is still that Gossip should be written in a Lisp-like language - and, for now, in Clojure - simply because that is most comfortable to me. It needs bidirectional socket communication with the game engine, over which it sends either [extensible data notation](https://github.com/edn-format/edn) or [JavaScript Object Notation](https://www.json.org/json-en.html), with a preference for the former.
## Tracking what happens in the world
Existing game engines don't tend to track in convenient form things which have happened off-camera - indeed, mostly, things don't happen at all when the player isn't present. They don't even track much that happens when the player is present, and they usually track what they do track in fairly ad-hoc ways. So generally Gossip-as-library will have to maintain its own history of what has happened, and who knows what about what has happened; and will have to model the major life events of non-player characters happening off-camera (if this is done at all) itself.
## Interrogating lore
Many games have a great deal of lore and many lore texts. It's reasonable to expect each non-player character to know a certain amount of lore, certainly lore which is local to their home location, or relevant to their trade. In order to make that available to Gossip, you probably need to construct a searchable corpus of all the lore, which can be simply queried.
That obviously then needs to be filtered by what the respondent can be expected to know, but that's a problem Gossip has to handle anyway.
## Interrogating the map
### get-character-location *id*
Returns the player location in the world of the character with the specified id, as at minimum a three dimensional coordinate tuple, with heading; optionally with hierarchical region ids.
### get-potential-auditors *id*
### get-potential-auditors *id*, *volume*
Return an ordered list of ids of characters spatially close to the character with the specified id, ordered by their likelihood of being the character addressed (i.e. preferring characters in front of the character with the specified id to those off to the side or behind, on a sort of cardioid pattern). The set is bounded by the distance at which speech is deemed to be intelligible, which may be a constant, or maybe modified by some modelling of ambient noise, or the volume of the character's speech act.
### get-potentially-aware *id*
### get-potentially-aware *id*, *volume*
As above, but return a list of ids of characters within a distance in which speech may be heard but not intelligibly.

33
doc/Appraisal.md Normal file
View file

@ -0,0 +1,33 @@
# Appraisal (unfinished)
## What is Appraisal
There's an thing that all non player characters can do, which varies greatly from person to person, and which is of particular importance to merchants, and that is appraisal.
Each category of goods has different dimensions of quality. A sword may be evaluated, for example, on
| Dimension | Better is | Ease of appraisal |
| -------------------- | ---------------------------------- | ----------------- |
| Hardness | More | Difficult |
| Toughness | More | Difficult |
| Wear | Less | Intermediate |
| Weight | There's a sweet spot, but it's low | Easy |
| Length | Judgement call | Easy |
| Decoration/Showiness | Judgement call | Intermediate |
| Workmanship | Better | Intermediate |
A person learns to appraise the qualities of a sword by having direct experience of swords with a range of values for the particular quality. A person who's only ever handled one sword does not know whether that sword heavy or light, pristine or worn. However, once a person has handled a dozen swords of different weights, they'll have some idea of what weight an average sword is, even if their idea may actually be a little off. Weight and length are easy to assess.
Similarly, once someone has handled a few dozen swords with different degrees of wear, will have an idea of how many chips, how much corrosion or pitting, is normal. Wear is harder to assess, but it doesn't need particular techniques or skills to assess, just observation. To assess hardness, you really need to have sharpened the blade and then used it to the extent that it needs sharpening again, but if you've handled a lot of blades of varying qualities you may associate patterns in the steel, such as pattern welding, damascus steel, or a hamun, or particular markers' marks, with varying hardnesses. Toughness is even harder to assess (without actually chipping or breaking the blade) and is really going to come down to recognising either high quality steels or particular makers' marks.
## Developing appraisal skill
So: how does one gain experience? I'm going to assume that anyone who's bought a sword has handled it before making the choice. That anyone who's survived on the winning side f a battle unwounded will also have handled eight of each type of weapon used, for each such battle (the victors will have the pick of the spoils on the battlefield). That a weapon smith has handled sixteen for each year they've been working. And possibly that a master weapon smith will at least examine more weapons in a year than a journeyman, who will at least examing more than an apprentice. But, essentially, appraisal skill develops with exposure to items in the particular category. The exact mechanism for tracking this I'm unsure of, because there is a tradeoff between richness of records and data compactness, and this game looks like getting rather big.
Of course, some people may be more observant than others, so it's possible that some people may gain appraisal skill on the basis of less exposure than others. But at this moment that's not a thing I'm planning to model.
## What does appraisal skill buy you?
In any category of goods, some individual items are better than others, and this difference may be significant. A person with good appraisal skill will recognise this difference. So a person with good skills, offered two items at the same price, will be able to select the better one; if bargaining for an item, will be prepared to offer a higher price for the better one; if selling items, will be prepared to sell the better one only for a higher price.
Price arbitrage is how a static merchant makes money.

View file

@ -2,7 +2,9 @@
#### Wednesday, 8 May 2019
![Devogilla's Bridge in Dumfries, early foourteenth century](https://2.bp.blogspot.com/-qxkySlJNmtY/XNKvJksmSjI/AAAAAAAAnXU/z1Zv2LmjydMmi_1q2mWdwVALmdfi9OItwCLcBGAs/s1600/Devorgillas-Bridge.jpg)
![Devorgilla's Bridge in Dumfries, early fourteenth century](https://2.bp.blogspot.com/-qxkySlJNmtY/XNKvJksmSjI/AAAAAAAAnXU/z1Zv2LmjydMmi_1q2mWdwVALmdfi9OItwCLcBGAs/s1600/Devorgillas-Bridge.jpg)
*Devorgilla's Bridge in Dumfries, early fourteenth century. This clearly shows how a genetic buildings approach to bridges can be made to work: a single element is repeated to span the necessary distance. That element can be stretched vertically and laterally to match the location, and can be rendered in different stone finishes to match local geology.*
In previous posts, I've described algorithms for dynamically [populating](Populating-a-game-world.html) and dynamically [settling](Settling-a-game-world.html) a game world. But at kilometre scale (and I think we need a higher resolution than that - something closer to hectare scale), settling the British Isles using my existing algorithms takes about 24 hours of continuous compute on an eight core, 3GHz machine. You cannot do that every time you launch a new game.
@ -72,7 +74,7 @@
## Phase four: eating!
At the end, though, you have a game, and a player plays it. How much of the dynamic, organic life that brought the game through proving continues on into the playing phase? If the [gossip](The-spread-of-knowledge-in-a-large-game.html) ideas are to work, if unscripted, non-plot-related events (as well as scripted, plot related events) are to happen while the player plays, if news of these events is to percolate through the world and reach the player in organic, unscripted ways, if a lot of the emergent gameplay I'm imagining is to work, then quite a lot of the dynamic things must be happening.
At the end, though, you have a game, and a player plays it. How much of the dynamic, organic life that brought the game through proving continues on into the playing phase? If the [gossip](The-spread-of-knowledge-in-a-large-game-world.html) ideas are to work, if unscripted, non-plot-related events (as well as scripted, plot related events) are to happen while the player plays, if news of these events is to percolate through the world and reach the player in organic, unscripted ways, if a lot of the emergent gameplay I'm imagining is to work, then quite a lot of the dynamic things must be happening.
Of course, part of this depends on the length of 'game world time' is expected to elapse in the course of one play through of the game. If it's less than a year, then you don't need children dynamically being born, and characters dynamically growing older; but if more, then you do. Similarly, you don't need a real simulation of trading to dynamically drive prices in markets, but for a fun trading sub-game to emerge, you probably do, and if you are using merchants as news spreading agents the additional compute cost is not high.

130
doc/Biomes_and_ecology.md Normal file
View file

@ -0,0 +1,130 @@
# Biomes and ecology (unfinished)
*The motivation for this document was to explain the mulberry trees in the Tcha valley, and think about why Tchahua is especially a centre for the silk trade*
## Broader geography
The broader geography of the world is not a matter for this document, but TODO: there isn't yet a document which usefully describes it, and there needs to be.
## Biomes relevant at this stage
### 1. Steppe
The centre of the continent is the steppe; it is generally too arid for forest growth, and is therefore scrub and grassland. There is one principal river system, which feeds into a marshland in the south, from which the water then goes underground beneath the limestone plateau to become the Tcha and Sind rivers. In late summer there's little water in the river, and few other waterholes. Antelope, camels, horses, goats, possibly sheep are native to the steppe, and there are probably something like leopards which predate on them, but I haven't fleshed it out.
Big dragons don't hunt on the steppe because they can't take off from flat ground, but smaller dragons may do so.
Settled by the steppe tribes, who are nomadic herders, extremely warlike but not technically highly developed. They are the game world's principle horse breeders. Basically in the game as I'm working on it at present, the player cannot go north across the steppe because the steppe tribes are too hostile.
A single major road, the Caravan Road, runs north to south across the steppe. There were in the past fortified caravanserrais along the length of the road, established and protected by Hans'hua, but they have been progressively overrun and destroyed by the steppe tribes and are now ruinous. Only one remains: the North Inn, just below the northern slope of the plateau. There is some limited horticulture on land close to the South Inn, supplying markets in Hans'hua.
### 2. Plateau
The limestone plateau runs along the whole of the southern edge of the steppe, from the western massif to the rim of the crater which forms The Great Place. It is a landscape of clints and grykes, on which nothing grows, and on which there is no water. It is about four day's journey by fast horse from north to south. The caravan road crosses the plateau from the North Inn to another caravanserrai, the South Inn, located in the north end of the Tcha valley. Because of the dense chaotic pattern of clints and grykes and the lack of accessible water, it is effectively impossible to cross the plateau other than by the caravan road, or by another path to the extreme east of the plateau, where it abuts the mountains of the Rim.
#### 2.1 Hans'hua
There is one city, Hans'hua, on the caravan road about half way across the plateau, where wind-pumps lift water from the underground river. Apart from this one city, nothing lives on the plateau. Migrating birds cross it, and that is all.
The city is small, walled, and run as an extreme neoliberal oligarchy; the city's main industry is maintaining the wind pumps, and its entire income is from tolls on caravans passing along the caravan road. This has been, and is still, extremely lucrative, but it is obvious both to the long distance merchants and to the oligarchs that the new ships are going to make the caravans too slow, too risky and too expensive to compete, and that as more ships are built, traffic on the caravan road will dwindle.
### 3. Massif
There's a granite intrusion which forms the entire western coast of the continent. It's geologically old and consequently the hills, though high, are rounded rather than jagged; at the southern end of the range (which is the only part that's in the least fleshed out yet) they're not snow covered in summer. As the prevailing winds are westerly, this massif intercepts most of the rain, which is why the steppe is arid.
Consequently it's pretty thoroughly forested, and the southern parts of it are mainly broadleaf forests including high quality hardwoods and many fruiting trees. Understory typical of mediterranean littoral forests, about which I don't really know enough.
Deer, cattle, pigs, wolves, leopards, badgers, squirrels… masses of birds of all appropriate types.
Because it's an old granite intrusion, the soil in the valleys is largely clay. There are mineral rich veins with a considerable range of minerals, but, obviously, not all in the same place.
Settled by the Western Clans, a negroid people living mainly in small isolated villages in the forest, with mostly limited agriculture.
#### 3.1 Northern massif
I haven't yet fleshed this out, but there are probably permanent snows and the forests are probably coniferous. It's my current working assumption that the new great ships are built from old growth conifers, taken from forests in the northern massif; but as I say this is not yet fleshed out.
The northern culture have developed very high quality ceramics using clay from the massif, including stonewares and porcelaines. I think the same clays also exist in the south of the massif, but the technology for producing high quality ceramics does not exist there. The northerners are also making high quality steels from magnetite and haematite from the massif. Whether these ores exist in the south I don't yet know.
#### 3.2 Dor
The northernmost of the western clans, the Dor, live in the central massif north of Andale, but apart from the fact that they exist and they're there, I don't yet really know much.
#### 3.3 Andale
The river An rises in the east of the massif near the south-west corner of the steppe, west of where the village and market of Dawnhold now stand, and flows more or less due westward. There are two major drops in the river's course, the upper a day's travel east of Silverhold, which is an actual fall of at least six metres, and the lower at Anghold. Between Anghold and Silverhold the river is navigable by small shallow draught boats; west of Anghold it is navigable down to the sea at Anmouth.
There are freshwater and migratory fish in the river, and fishing is a source of protein and livelihood the whole length of the valley.
The valley is largely forested. Apart from wild animals, domestic cattle and pigs are herded in the forest. Trees include alder, almond, apple, apricot, ash, beech, birch, cherry, chestnut, hazel, holly, lime, maple, mulberry, oak, orange, pear, walnut, yew.
##### 3.3.1 Dawnhold
Dawnhold isn't strictly geographically in Andale — it's east of, on the steppe side of, the watershead, but it marks the eastern border of the lands settled by clan An. There's an annual market, a village, and a garrisoned fortification to deter raids by the steppe tribes.
##### 3.3.2 Silverhold
Small town serving the only significant silver mine in the world. A tributary flows in from the north here, but I know nothing about it yet. There is a major fortification/refinery/treasury. All around Silverhold, right up to the headwaters of the An and right down to Anghold, the valley is forested with only small clearings round villages, which are mainly close to the river.
Many other metals — certainly inluding lead, tin, and small quantities of gold, probably not copper — come out of the mines at Silverhold.
The An produce enough ferrous metals for their own tools and weapons, but their iron smelting technology is not advanced and they don't export iron or iron products. They produce eathernware ceramics for domestic consumption. They produce leather and linen, and textiles from nettle fibres. They produce timber, which is their principal building material, but they don't export it. In practice their major export is silver coinage.
##### 3.3.3 Longwater
Longwater is a long, narrow lake, like Loch Lomond, on a tributary which flows into the An from the south, joining upstream from Anghold. There is no major nucleated settlement on Longwater, but there are sufficient small villages and hamlets on its banks to form an identifiable settlement cluster. Small boats can make it downstream from Longwater from the An and back, probably with some degree of portage around rapids. There's a pass over from the south of the Longwater valley to Gor territory, but it's high, difficult, and not much used. The whole of the Longwater valley is broadleaf forest.
##### 3.3.4 Anghold
There's a small town, market and fortification — Anghold — on the south bank of the An, just above first cataract, where boats are portaged up from the lower river to the middle reach. Downstream from Anghold the river is wider, slower and more meandering, with marshy banks. The valley west of Anghold, especially on the southern side, is also more populated, with more of the forest cleared and more arable agriculture.
##### 3.3.5 Anmouth
The An meets the sea at Anmouth, where there is a deep harbour at a bend in the river just east of a long estuary, There is a bar, making it dangerous to enter the harbour in bad weather, and the whole estuary is pretty exposed to western storms, although there may be some islands providing some shelter for emergency anchorages — I don't have that level of detail yet. Certainly the big new ships do not yet call in here, but could.
There are farming and sea-fishing villages down both sides of the estuary. There is no tradition of ship building, however.
#### 3.4 Gor
Clan Gor occupy the south-western peninsula of the continent, and the south slope of the massif, east almost as far as the Tcha valley. Their land is forested with a similar mix of trees to Andale. They have no major rivers, but several minor ones. They live mainly in coastal villages, and sea fishing is a major economic activity. They have no deep water ports.
In addition they do mine iron, and they have exported swords, but the market for their swords is being undercut by better crucible steel swords from the north now being imported into the Cities of the Coast by the new ships. Similarly, the Gor used to export earthenware, but that too is now being undercut by stonewares and porcelaines from the north.
Because of a history of being victims of raiding from the Cities of the Coast, the Gor maintain a fortified eastern border along the line of hills to the west of the Tcha valley. Nevertheless they have mostly good trading relationships with Tchahua. In particular they export large quantities of raw and spun silk, and some woven silk cloth, to Tchahua.
I don't yet have nearly a clear enough picture of the organisation and layout of the Gor lands, but their major stronghold and administrative centre must be to the east. While they traditionally had the communist and democratic culture of the other Western Clans, one family have become dominant and have become effectively hereditary leaders, influenced by the cultures to their east. However the leading family do not self-identify as aristons.
### 4. Coast
"The Coast" is the name given to the southern littoral of the continent, west of the Great Place and east of the Massif. It's limestone, with deeply cut, steep sided valleys separated by high, arid uplands, with scrubby vegetation, grazed by domestic sheep and both domestic and wild goats.
The native culture were peaceable, communistic agriculturalists, not greatly different from the Western Clans. However some several hundred years ago they were invaded by a warrior group from the steppe tribes, who established themselves as a military aristocracy — the Aristae — and started to build cities — and impose taxes onto the peasantry, forcing them into a more or less cash oriented economy.
The valleys were once forested, but the central valleys, which were in any case rather dryer and where the Aristae first settled and established cities, are now mostly cleared, and are a mix of pastoral and arable, with considerable viticulture.
#### 4.1 Tcha valley
The Tcha is the westernmost — and largest — river of the coast. It emerges from under the plateau at a pool under the South Tower marking the southern limit of Hans'hua territory and runs south more or less along the divide between the granite to the west and the limestone to the east. It is still largely forested, partly because it is relatively recently occupied by the Aristae, but partly because of the growth of the silk industry. This has led to some forested areas, especially near the navigable reaches of the river, being converted into mulberry orchards. However, there's still a great deal of mixed forest, and the majority of mulberry leaves for feeding to silk worms are gathered from natural forest.
A road branches off from the main Caravan Road at the South Inn and runs down the eastern side of the valley, to a ferry across the Sind river, where it joins the Tcha as a tributary, at the village helpfully known as Sind Ferry, and thence to Tchahua.
Mulberries, by-products of the silk industry, are used in the production of brandy. Mulberry wine is produced in villages in the forest, and transported down river to a distillery at Sind Ferry, where it is distilled. Some mulberry wine may be sold in Tchahua for drinking as wine (and it is certainly drunk in the villages), but it is generally considered inferior to grape wine.
There is some arable and mixed agriculture, mainly towards the southern end of the valley on the western (less steep) side, although this side is also largely forested.
##### 4.1.1 Tchahua
The city of Tchahua lies on the east bank of the river at the head of its estuary, and has deep water — the only really usable deep water port on the coast, being not only the largest river but also the least silted. Until quite recently it had been a small provincial silk weaving city, nominally independent but in fact paying tribute to both Sinhua to its east and the Gor to its west, in order to avoid being formally conquered by either.
There's a multi-span bridge here — I think a pontoon bridge — of which the eastern most span is a drawbridge which can be lifted into a fortified gateway on the eastern (Tchahua) shore. There is a fishing industry, but as the eastern side
Industries are silk weaving and dying, and fishing. Very recently, a new deep water quay has been constructed and the first large ships have begun to call. It is obvious that the city is going to become much more important as a strategic market and transport hub, but that has only just begun to have effect.
### 4.2 Sind valley
#### 4.2.1 Sinhua

View file

@ -0,0 +1,9 @@
# Building on Microworld
In [Settling a Game World](Settling-a-game-world.html) I intended that a world should be populated by setting agents - settlers - to explore the map and select places to settle according to particular rules. In the meantime, I've built [MicroWorld](https://github.com/simon-brooke/mw-ui), a rule driven cellular automaton which makes a reasonably good job of modelling human settlement. It works, and I now plan to use it, as detailed in this note; but there are issues.
First and foremost, it's slow, and both processor and memory hungry. That means that at continent scale, a cell of one kilometre square is the minimum size which is really possible, which isn't small enough to create a settlement map of the density that a game will need. Even with 1 km cells, even on the most powerful machines I have access to, a continent-size map will take many days to run.
Of course it would be possible to do a run at one km scale top identify areas which would support settlement, and then to do a run on a ten metre grid on each of those areas to more precisely plot settlement. That's an idea which I haven't yet explored, which might prove fruitful.
Secondly, being a cellular automaton, MicroWorld works on a grid. This means that everything is grid aligned, which is absolutely not what I want! So I think the way to leverage this is to use MicroWorld to establish which kilometre square cells om the grid should be populated (and roughly with what), and then switch to *ad hoc* code to populate those cells.

View file

@ -0,0 +1,55 @@
# Canonical dictionary for this documentation
Where a word is used in the documentation for The Great Game and its related projects, this file describes the canonical meaning of that word. This is because a lot of the concepts in play are messy and ambiguous, so that at times even I am confused by what I mean. The presence of this file is an acknowledment of this difficulty, and an implicit admission that not all the documentation is, at this stage anyway, consistent.
#### Actor
An `actor` is a thing which performs actions within the game world. Thus a tree is (almost certainly) not an actor, and things like sheep and rabbits that run about are probably not actors, but an animal which may pro-actively interact with the player character (such as a predator, or a beast of burden, or even a prey species which may flee) is an actor. In [god mode](#God_mode), if implemented, the player can inhabit any actor within the game world.
#### Agent
`Agent` is probably just a synonym for `actor`. If it is different in any way, that way has not yet been determined.
#### Gossip
A `gossip` is an `actor` who exchanges news with other `actors`, even when the player character is not nearby. Thus `gossips` are the mechanism by which news propagates through the game world, and also the mechanism by which information degrades. Broadly:
1. `innkeepers` (and possibly some others) are `gossips` who do not move; rather, they gather information from gossips who do move, and all `non-player characters` local to the are deemed to know everything that their local `innkeeper` knows;
2. `merchants` (and possibly some others) are `gossips` who do move from place to place, and thus transfer news.
See [the spread of knowledge in a large game world](The-spread-of-knowledge-in-large-game.html).
#### Heightmap
A `heightmap` is a raster image of the world, such that the intensity in which an area is coloured represents the value of some variable, by default height, of that area.
#### Holding
A `holding` is a polygon 'owned' by an `actor` on which are built appropriate building units representing the `actors` craft and status.
#### Location
A `location` value is a sequence comprising at most the x/y coordinate location and the ids of the settlement and region (possibly hierarchically) that contain the location. If the x/y is not local to the home of the receiving agent, they won't remember it and won't pass it on; if any of the ids are not interesting, they won't be passed on. 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.
**Examples**
1. \[{:x 5445678 :y 9684351}\]
2. \[{:x 5445678 :y 9684351} :karalin-palace :hanshua\]
#### Merchant
A `merchant` is an `actor` and `gossip` who trades goods, and incidentally conveys news, between `markets`.
#### Non-player character
A `non-player character` is, for our purposes, an `actor` capable of engaging in conversation with the `player character`. Note, however, that, from a software point of view, the `player character` is just a special case of a `non-player character`.
#### Player character
The `player character` is the unique `actor` within the game currently controlled and inhabited by the player.
#### Route
A `route` is a pre-prepared path through the game world that an `actor` may take. Most `actors` are not constrained to follow `routes`, but in general `routes` have lower traversal cost than other terrain.

View file

@ -0,0 +1,27 @@
# Division of tasks between server and client
An alternative nomentclature I may use for this dichotomy would be _planner_ and _performer_; it would be the same dichotomy. 'Planner' and 'server' are synonyms; 'performer' and 'client' are synonyms.
## What do I mean by the 'server'?
There is something which manages game state and things like the gossip network, merchant network, and major world events. This something is almost certainly written in some form of Lisp; I'd prefer Clojure but I don't think it's performant enough so probably Common Lisp. This means that it has inevitable pauses for garbage collection. Underneath this is a database which handles persistent storage of game state, which is probably an SQL database and quite likely [SQLite](https://www.sqlite.org/index.html).
The initial idea of The Great Game is that it is a single player game, but it actually doesn't need to be and it would be quite possible for one server to support multiple clients, each being used by a different player.
The server/planner decides what each actor does, models what each character knows, plans and records all actions and transactions. It plans speech acts, and handles conversations which happen off screen, but hands speech texts over to the client/performer layer for actual performance. It also plans journeys as described in [Pathmaking](Pathmaking.html), but it doesn't deal with movement within a polygon or with collision avoidance. It deals with fights which happen off screen, but not those that happen on screen.
## What do I mean by the client?
There is something that renders an interesting and lively display of the part of the game world that the player can see from their current position. This display has to run without significant pauses — it's not OK, for example, for all conversation to stop suddenly in a market place just because the server is garbage collecting.
The client is written in some high level game engine system, possibly Unreal Engine (although for ideological reasons I'd prefer an open source one).
The client/performer renders and animates everything the player character can see, and performs every sound the player character can hear. In doing this it is responsible for
1. The rendering of landscape, vegetation, buildings, furniture, and everything else that is fixed within the visible scene;
2. The animation of everything which moves within the visible scene, and, to facilitate this, detailed route planning and collision avoidance;
3. The performance of all speech acts and gestures, all musical performance, and the playing of all [foley](https://en.wikipedia.org/wiki/Foley_(filmmaking)) sounds;
4. Combat which happens in the field of view, including specifically all combat (including sparring) involving the player character. This means that the client/performer is the bit of the system which decides what blows are struck and whether they hit their targets, and consequently which character wins each fight. It reports this information back to the server.

View file

@ -0,0 +1,63 @@
# On the consequences of a dynamic game environment for storytelling
First, a framing disclaimer: in [Racundra's First Cruise](https://books.google.co.uk/books?id=Ol1-DwAAQBAJ&lpg=PP1&pg=PT77#v=twopage&q&f=false), Arthur Ransome describes coming across a half built — and by the time he saw it, already obsolete — wooden sailing ship, in a Baltic forest. An old man was building it, by himself. He had been building it since he had been a young man. It's clear that Ransome believed the ship would never be finished. It's not clear whether the old man believed that it would, but nevertheless he was building it.
I will never build a complete version of The Great Game; it will probably never even be a playable prototype. It is a minor side-project of someone who
1. Is old and ill, and consequently has inconsistent levels of energy and concentration;
2. Has other things to do in the real world which necessarily take precedence.
Nevertheless, in making design choices I want to specify something which could be built, which could, except for the technical innovations I'm trying myself to build, be built with the existing state of the art, and which if built, would be engaging and interesting to play.
The defining characteristic of Role Playing Games — the subcategory of games in which I am interested — is that the actions, decisions and choices of the player make a significant difference to the outcome of the plot, significantly affect change in the world. This already raises challenges for the cinematic elements in telling the game story, and those cinematic elements are one of the key rewards to the player, one of the elements of the game's presentation which most build, and hold, player engagement. These challenges are clearly expressed in two very good videos I've watched recently: [Who's Commanding Shepard in Mass Effect?](https://youtu.be/bm0S4cn_rfw), which discusses how much control the player actually has/should have over the decisions of the character they play as; and [What Happened with Mass Effect Andromedas Animation?](https://youtu.be/NmLPpcVQFJM), which discusses how the more control the player has, the bigger the task of authoring animation of all conversations and plot events becomes.
There are two key innovations I want to make in The Great Game which set it apart from existing Role Playing Games, both of which make the production of engaging cinematic presentation of conversation more difficult, and I'll handle each in turn. But before I do, there's something I need to make clear about the nature of video games themselves: what they are for. Video games are a vehicle to tell stories, to convey narrative. They're a rich vehicle, because the narrative is not fixed: it is at least to some degree mutable, responsive to the input of the audience: the player.
Clear? Let's move on.
The innovations I am interested in are
## Unconstrained natural speech input/output
I want the player to be able to interact with non-player characters (and, indeed, potentially with other player characters, in a multi-player context) simply by speaking to them. This means that the things the player character says cannot be scripted: there is no way for the game designer to predict the full repertoire of the player's input. It also means that the game must construct, and put into the mouth of the non-player character being addressed, an appropriate response, given
1. The speech interpretation engine's interpretation of what it is the player said;
2. The immediate game and plot context;
3. The particular non-player character addressed's knowledge of the game world;
4. The particular non-player character's attitude towards the player;
5. The particular non-player character's speech idiosyncracies, dialect, and voice
and it must be pretty clear that the full range of potential responses is extremely large. Consequently, it's impossible that all non-player character speech acts can be voice acted; rather, this sort of generated speech must be synthesised. But a consequence of this is that the non-player character's facial animation during the conversation also cannot be motion captured from a human actor; rather, [it, too, must be synthesized](https://youtu.be/fa3_Mfqu8KA).
This doesn't mean that speech acts by non-player characters which make plot points or advance the narrative can't be voice acted, but it does mean that the voice acting must be consistent with the simulated voice used for that non-player character — which is to say, probably, that the non-player character must use a synthetic voice derived from the voice performance of that particular voice actor in that role.
**Note that** this has interesting consequences for social equity with regard to those whose current profession is voice acting video games. Automating work people do generally has the consequence of putting those people out of work, or at least of making their work less valuable and consequently less remunerative. Almost everyone who has worked in software has to some extent done this. I'm not avoiding or ignoring the ethical issue here. I would argue in mitigation that because games of the type I am suggesting can never be voice acted, I'm not replacing work any real actors will ever do, but that is tendentious since if games of this sort are built and are successful they will compete for audience attention with games which are voice acted.
## Dynamic game environment
Modern Role Playing Games are, in effect, extremely complex state machines: if you do the same things in the same sequence, the same outcomes will always occur. In a world full of monsters, bandits, warring armies and other dangers, the same quest givers will be in the same places at the same times. They are clockwork worlds, filled with clockwork automata. Of course, this has the advantage that is makes testing easier — and in a game with a complex branching narrative and many quests, testing is inevitably hard.
Interestingly, [Kenshi](https://lofigames.com/) — a game I'm increasingly impressed and influenced by — is not quite clockwork in this sense. As the player upsets the equilibrium of the game's political economy, factions not impacted negatively will move against competing factions which are impacted negatively, in a way which *may* be scripted, but it's so well done it's hard to tell.
My vision for The Great Game is different. It is that the economy — and with it, the day to day choices of non-player characters — should be modelled. This means, non-player characters may unexpectedly die. Of course, you could implement a tag for plot-relevant characters which prevents them being killed (except when required by the plot).
## Plot follows player
As Role Playing Games have moved towards open worlds — where the player's movement in the environment is relatively unconstrained — the clockwork has become strained. The player has to get to particular locations where particular events happen, and so the player has to be very heavily signposted. Sometimes the mark you have to hit to trigger the next advance of the plot can be extremely awkward; [an example from Cyberpunk 2077](https://youtu.be/GEYkuctBUYE?t=2990) is finding the right spot, in the quest 'They Won't Go When I Go', to trigger the button which raises the cross.
Another solution — which I'd like to explore — is 'plot follows character'. The player is free to wander at will in the world, and plot relevant events will happen on their path. And by that I don't mean that we associate a set of non-player characters which each quest — as current Role Playing Games do — and then uproot the whole set from wherever they normally live in the world and dump them down in the player's path; but rather, for each role in a quest or plot event, we define a set of characteristics required to fulfil that role, and then, when the player comes to a place where there are a set of characters who have those characteristics, the quest or plot event will happen.
## Cut scenes, cinematics and rewarding the player
There's no doubt at all that 'cut scenes' — in effect, short movies spliced into game play during which the player has no decisions to make but can simply watch the scene unroll — are elements of modern games which players enjoy, and see to some extent as 'rewards'. And in many games, these are beautifully constructed works. It is a very widely held view that the quality of cutscenes depends to a large degree on human authorship. The choices I've made above:
1. We can't always know exactly what non-player characters will say (although perhaps we can in the context of cut scenes where the player has no input);
2. We can't always know exactly which non-player characters will speak the lines;
3. We can't predict what a non-player character will say in response to a question, or how long that will take;
4. We can't always know where any particular plot event will take place;
each make the task of authoring an animation harder. The general summary of what I'm saying here is that, although in animating a conversation or cutscene what the animator is essentially animating is the skeletons of the characters, and, provided that all character models are rigged on essentially similar skeletons, substituting one character model for another in an animated scene isn't a huge issue, with so much unknowable it is impossible that hand-authoring will be practicable, and so a lot will depend on the quality of the conversation system not merely to to produce convincingly enunciated and emoted sound, but also appropriate character animation and attractive cinematography. As you will have learned from the Mass Effect analysis videos I linked to above, that's a big ask.
Essentially the gamble here is that players will find the much richer conversations, and consequent emergent gameplay, possible with non-player charcaters who have dynamic knowledge about their world sufficiently engaging to compensate for a less compelling cinematic experience. I believe that they would; but really the only way to find out would be to try.
Interestingly, an [early preview](https://youtu.be/VwwZx5t5MIc?t=327) of CD Project Red's [Cyberpunk 2077](https://www.cyberpunk.net/us/en/cyberpunk-2077) has relatively few cutscenes, suggesting that these very experienced storytellers don't feel they need cutscenes either to tell their story or maintain player engagement.

View file

@ -6,7 +6,7 @@ Broadly this essay extends ideas presented in [Populating a game world](Populati
### Herdsfolk
Herdsfolk are nomadic; it's reasonable to think they'll bring their herds to market, rather than selling it lots of tiny markets. So in the spring, shepherds will visit specific towns at the edge of open land, to hold a shearing festival/carnevale; and that both shepherds and cattle herders will visit towns on the edge of open land to sell fatstock in the autumn.
Herdsfolk are nomadic; it's reasonable to think they'll bring their herds to market, rather than selling at lots of tiny markets. So in the spring, shepherds will visit specific towns at the edge of open land, to hold a shearing festival/carnevale; and that both shepherds and cattle herders will visit towns on the edge of open land to sell fatstock in the autumn.
### Miners
@ -32,18 +32,22 @@ Farmers are settled. Farmers occupy standard runrig plots, but because they don'
* fibres: linen, hemp and silk (from silk-moths in mulberry orchards)
* possibly other stuff I've forgotten.
Farmers are all basically subsistence farmers, farming first to feed their own household and selling only surplus in the market.
Farmers are all primarily subsistence farmers, farming first to feed their own household and selling only surplus in the market.
## Crafts
Crafts generally process primary goods into secondary goods - whether intermediate stages or final consumer items. Some elite 'crafts' deal with abstract primary goods like law and knowledge, and they may be seen as somewhat separate.
Crafts generally process primary goods into secondary goods — whether intermediate stages or final consumer items. Some elite 'crafts' deal with abstract primary goods like law and knowledge, and they may be seen as somewhat separate.
A master craftsperson occupies a standard runrig plot, much like a farmer's plot. Like a farmer, a poor master crafter household will cultivate part of the plot to produce food for the house - at least grow vegetables and keep hens. However, as the crafter takes on apprentices and journeymen - and gets richer - more buildings will be required as accommodation, workshop space and materials stores.
A master craftsperson may occupy a standard runrig plot, much like a farmer's plot. Like a farmer, a poor master crafter household will cultivate part of the plot to produce food for the house — at least grow vegetables and keep hens. However, as the crafter takes on apprentices and journeymen — and gets richer — more buildings will be required as accommodation, workshop space and materials stores.
Generally, primary goods aren't transported over land - because overland transport is expensive, by the time they've been transported they're no longer low cost goods. So often the craftspeople who process primary produce into at least commodity intermediate forms will live close to the source of the primary goods.
Also, Tchahua is much more a gold-rush town than an organic, grew over hundreds of years sort of town, so it is not ex-runrig; and additionally the original settlement was probably along the river bank, land which has now been redeveloped as warehouses and as rich merchant residences. Generally, town house plots are small from the get go.
Hans'hua is again an exception from normal organic development, as it has no agricultural land close to the city at all.
Generally, primary goods aren't transported over land — because overland transport is expensive, by the time they've been transported they're no longer low cost goods. So often the craftspeople who process primary produce into at least commodity intermediate forms will live close to the source of the primary goods.
So, for example, the town(s) where the shepherds hold their shearing fairs will tend to have a lot of weavers. While around mines there will be smelters producing ingots and bar stock to be marketed to smiths all over the place, there will also be smiths close to the mines producing commodity tools and weapons.
See the table in Populating a game world.
See the tables in [Populating a game world](Populating-a-game-world.html).

11
doc/Further-reading.md Normal file
View file

@ -0,0 +1,11 @@
# Further Reading (and watching)
Work by other people which is relevant to what I'm doing, and which I should study.
## Modelling the natural environment
1. [Synthetic Silviculture: Multi-scale Modeling of Plant Ecosystems](https://storage.googleapis.com/pirk.io/projects/synthetic_silviculture/index.html) — see also [this video](https://youtu.be/8YOpFsZsR9w).
## Systemic games
1. [This video](https://youtu.be/SnpAAX9CkIc) is thought provoking with excellent examples.

View file

@ -0,0 +1,7 @@
# Game-engine integration (unfinished)
To build a game using these ideas we need a lot of things that are well understood and already implemented: rendering a world, moving models of characters in a world, and so on. This collection of technologies which allow us to realise an interactive realisation of a world is typically called a game engine.
It's my intention that the bits that I add to the mix should be open source in the hard sense of that phrase, fully free software released under GPL. They cannot therfore be directly linked to a proprietary game engine.
But the current state of play is that the best and easiest to work with game engines are not open source; and while I could build a demo game using, for example, the [Godot engine](https://godotengine.org/) or [jMonkeyEngine](https://jmonkeyengine.org/) the result wouldn't be as compelling and *I believe* the effort would be more considerable than if I use [Unreal Engine](https://www.unrealengine.com/en-US), which is my current plan.

View file

@ -2,25 +2,25 @@
The principles of game play which I'm looking for are a reaction against all I see as wrong in modern video games. So let's set out what these are:
1. Superpower: the player character has some special powers or skills that other characters in the game fo not have.
1. **Superpower**: the player character has some special powers or skills that other characters in the game fo not have.
2. Special status: the player character is 'the chosen one', 'the hero', or even just 'the Witcher' from the very beginning, without having done anything to earn those titles.
2. **Special status**: the player character is 'the chosen one', 'the hero', or even just 'the Witcher' from the very beginning, without having done anything to earn those titles.
3. Boss fights: some non-player characters have special, and specially strong, combat repertoire, and block progress in the game until you overcome them.
3. **Boss fights**: some non-player characters have special, and specially strong, combat repertoire, and block progress in the game until you overcome them.
4. Psychokiller: completing the game necessarily involves beating many, many other characters in combat.
4. **Psychokiller**: completing the game necessarily involves beating many, many other characters in combat.
5. Slaughterhouse: the main way to interact with other characters is to kill them.
5. **Slaughterhouse**: the main way to interact with other characters is to kill them.
7. The Script is King: everything is scripted. The player either can't diverge from the script, or if they do, will find no interesting content.
7. **The Script is King**: everything is scripted. The player either can't diverge from the script, or if they do, will find no interesting content.
6. Dumb and dumber: non-player characters, even important ones, have extremely limited vocal repertoire.
6. **Dumb and dumber**: non-player characters, even important ones, have extremely limited vocal repertoire.
Of these, the last two, I think, are key: they are the root cause of the other problems. In fact, to take it further, the real key is the last. We talk a lot about 'Game AI', but really there's nothing remotely approaching artificial intelligence ins modern games. Non-player characters do not think; they do not learn; they do not reason; they do not know. They speak only from the script. And they speak only from the script because of the fetish for voice acting.
Of these, the last two, I think, are key: they are the root cause of the other problems. In fact, to take it further, the real key is the last. We talk a lot about 'Game AI', but really there's nothing remotely approaching artificial intelligence in modern games. Non-player characters do not think; they do not learn; they do not reason; they do not know. They speak only from the script. And they speak only from the script because of the fetish for voice acting.
## Death to Dumb-Dumb
## Death to Dum-Dum
As I've argued [elsewhere](), [repeatedly](), we can now generate a wide variety of naturalistic speaking voices, and have them narrate text. Now of course there's great deal of information conveyed in human vocal communication in addition to the words of which emotion is only an example, although an important one. Generating voices with the right tone, the right emphasis, for different situations may be harder than I anticipate; there may be an '[uncanny valley](Uncanny_dialogue)' in which generated speech just sounds uncomfortably off.
As I've argued [elsewhere](Voice-acting-considered-harmful.html), [repeatedly](Selecting_Character.html), we can now generate a wide variety of naturalistic speaking voices, and have them narrate text. Now of course there's great deal of information conveyed in human vocal communication in addition to the words of which emotion is only an example, although an important one. Generating voices with the right tone, the right emphasis, for different situations may be harder than I anticipate; there may be an '[uncanny valley](Uncanny_dialogue.html)' in which generated speech just sounds uncomfortably off.
But it's a trade off. For possibly less than perfect vocal performance, you get the possibility of much richer repertoire. You get not only the possibility that non-player characters can talk about the weather, or gossip about their neighbours, or give you directions to local places of interest. You get the possibility that a non-player character's attitude to you may be conditioned by the fact that they've heard that you stole from their second cousin, or that you killed an outlaw who'd raped one of their friends.
@ -28,7 +28,7 @@ Suddenly, they can have attitudes about things that happen in the world, opinion
And with the emergence of intelligent behaviour comes the emergence of possibilities for negotiation, for diplomacy, for dynamic, unscripted, friendships and romances. Which means, there are things you can do to interact with every non-player character, even ones who are not 'plot' characters, other than just kill them.
And as now gameplay possibilities emerge, as new stories emerge organically out of the dynamically changing relationships between non-player characters in the world, the need for scripting decreases.
And as new gameplay possibilities emerge, as new stories emerge organically out of the dynamically changing relationships between non-player characters in the world, the need for scripting decreases.
The problem with scripting is that it greatly limits player agency. The story can only have one of a few predetermined -- literally, scripted -- endings. This is clearly expressed in [a review of Red Dead Redemption 2](https://youtu.be/_JRikiQyzLA) which I recomment to you; but is equally true of almost all other games.
@ -36,5 +36,5 @@ Dynamic side quests have fallen into disfavour, because, when they've been tried
## Death to Psycho-Killer
If the main way a player can interact with non-player characters is to kill them, and if the player doesn't have a systematic combat advantage over non-player characters, then it's going to be a short game. This is why players in many or most video games do start with a systematic combat advantage, and that combat advantage tends to increase over the course of the game as the player becomes more proficient with the combat system, and acquires better weapons, armour and combat buffs. This in turn means that to keep combat 'interesting', the game either has to through larger and larger armies of 'bad' non-player characters against the player a fault seen at its worst in [Dragon Age 2](https://youtu.be/Sc8Bn8yqPYQ?t=3150).
If the main way a player can interact with non-player characters is to kill them, and if the player doesn't have a systematic combat advantage over non-player characters, then it's going to be a short game. This is why players in many or most video games do start with a systematic combat advantage, and that combat advantage tends to increase over the course of the game as the player becomes more proficient with the combat system, and acquires better weapons, armour and combat buffs. This in turn means that to keep combat 'interesting', the game has to through larger and larger armies of 'bad' non-player characters against the player a fault seen at its worst in [Dragon Age 2](https://youtu.be/Sc8Bn8yqPYQ?t=3150).

61
doc/Genetic-buildings.md Normal file
View file

@ -0,0 +1,61 @@
# Genetic Buildings
### Building selection based on location
The objective of this note is to create a landscape with varied and believable buildings, with the minimum possible data storage per instance.
Like plants, buildings will 'grow' from a seed which has northing and easting attributes. These locate a position on the map. Again, like trees, some aspects of the building type selector are location based. Aspects of the location which are relevant to building type are
* **elevation** — derived from the map location by interpolation from grid. The actual interpolation algorithm is probably some form of spline, but in any case it's the same one as for everything else.
* **orientation of slope** — derived by taking altitude at four corners of a 100 metre square centred on the seed point, and then taking the highest and lowest of these. If highest is northwest, lowest is southeast, the slope is considered to be oriented southeast; if highest is northwest and lowest southwest, the orientation is considered to be south, and so on. Eight orientation values are sufficient.
* **gradient of slope** — derived from the difference in altitude across the same 100 metre square
* **neighbours** — number of other buildings in 500 metre square centred on seed point.
The reason orientation is relevant is exactly the same as the reason it's relevant to trees. West facing slopes are assumed wetter (coriolis winds), so grow trees better, so better availability of better quality timber, so a higher probability of timber as a primary building material. But also, in areas of higher rainfall, rain shedding is an important consideration, so a higher value is placed on pitched roofs.
So you have the following general relationships
* west (or southwest or northwest) facing, moderate gradient, moderate altitude: high probability of timber construction; construction techniques involving large timbers (e.g. cruck frame); greater probability of shingled roofs;
* west (or southwest or northwest) facing, moderate gradient, higher altitude or northern latitude: high probability of building styles adapted to straight-trunk conifers, e.g. log cabins, stave buildings; greater probability of shingled roofs;
* east facing, generally: greater probability of flat roofs;
* steeper gradients: greater probability of stone buildings (steeper gradients = shallower topsoil and greater ease of quarrying = access to stone); greater probability of slate roofs;
* shallower gradients: greater probability of mud, cobb, brick or wattle-and-daub as building materials; greater probability of thatch or turf roofs;
* Higher number of neighbours: higher probability of two or more stories;
These factors allow classes of building to be selected. Having got past that point, we need to consider how classes of genetic building can work.
### Rectangular genetic buildings
Some genetic buildings will have cells with rectangular plan. This doesn't mean that genetic buildings are required to have rectangular cells, but they provide a starting point for discussion. For a given class of building (for example, timber frame), a number of prototype models of cells exist. These models are fully realised three dimensional models. Possibly all cells belonging to the building class have two open ends, and end walls exist as separate models; equally possibly, some cells have only one extensible end. In any case, a building will not normally comprise a single cell. Normally it will comprise multiple cells. So the cells belonging to a particular building class will be designed to 'plug together'. Multi story building classes will have some cells which are specifically ground floor only (flat ceiling, no roof), and such cells will always have an upper floor cell added above them. Where an upper floor cell has an outside door, an outside stair will automatically be added.
### Cell mutability
Although cell models are repeatedly reused they don't have to look the same every time they are reused. Within limits, every cell can be stretched along any of its three axes. Obviously, the degree of stretch on a given axis for every cell in a given building must be the same, otherwise they won't line up. Another mutable area is skinning — it may be possible to have alternate skins for cells, and even if there are not alternate skins, it will be possible to mutably darken, lighten or otherwise tint the skins used, within ranges which are appropriate to the materials represented. Obviously there are limits to stretching — timber comes in only such a length, stone lintels will only support such a span.
### Functional cells
Some trade functions require cells of particular kinds. Thus a smith needs a working building with one cell which is explicitly a forge. A water mill must have one cell which explicitly houses the mill gear. A forge cell or a waterwheel cell should never appear in weavers workshop. But most cells are not dedicated in this way. A bedroom cell is a bedroom cell, more or less; wealth may alter how it is furnished, but it may appear in any dwelling. Similarly, except for the very wealthy, a living cell is pretty much a living cell. And any building may incorporate a storage cell. If a given building class has twelve distinct 'generic' cells' and half a dozen distinct functional cells, and if buildings in the class average four cells each, then ignoring variance caused by skin mutability, a street of fifty buildings could have every one different.
### Reproducibility
It's critical that if a player visits a location, leaves it, and then returns, the buildings should not all have changed. So it must be possible to repeatedly reproduce the building at the location (this, of course, applies to other procedural scene dressing, such as trees, roads, boundaries, bridges and so on). This is possible if a deterministic random number generator is used which is seeded from the latitude and longitude attributes of the location. Other attributes which should be cached on the seed even though they are determined procedurally when the building is first instantiated include building class, purpose, and wealth. Using these attributes and the deterministic random number generator, the same building can be reproduced on the same site each time it is visited, with a very small amount of data stored.
Buildings will normally be built at the edge of the associated land holding. If an edge of the land holding adjoins a road, then the building will be built with one long side aligned to the road. Otherwise, the building will be built at right angles to the orientation of the slope. The orientation will be 'frozen' once the building has been instantiated and will be cached on the seed.
So, to build a building, use the following algorithm:
Seed the random number generator with latitude and longitude
```
while ( building value is less than wealth) {
select a cell selected from the building class using the next number from the random number generator modulo the number of generic cells in the class;
if the selected cell is not inappropriate to the building's function {
fit the cell to the building at the point determined by a deterministic algorithm
furnish cell using the random number generator to determine
furnishing types and locations from a selection appropriate to the cell
if the selected cell was not a top story cell {
         add a requirement that the next cell selected must be an upper story cell}
}
}
```

View file

@ -1,33 +1,33 @@
# Gossip, scripted plot, and Johnny Silverhand
I've been writing literally for years -- since [Voice acting considered harmful](Voice-acting-considered-harmful.html) in 2015 -- about game worlds in which the player speaks to non-player characters just by speaking the words they choose in their normal voice, and the non-player character replies using a pipeline that goes, essentially,
I've been writing literally for years — since [Voice acting considered harmful](Voice-acting-considered-harmful.md) in 2015 — about game worlds in which the player speaks to non-player characters just by speaking the words they choose in their normal voice, and the non-player character replies using a pipeline that goes, essentially,
1. Alexa/Siri style speech interpretation;
2. A decision on whether to co-operate based on the particular NPC's general demeanor and particular attitude to the player;
3. A search of the game state and lore for relevant information;
4. A filtering of the results based on what the particular NPC can be expected to know;
5. Generation of a textual response from those results based on a library of templates which defines the particular NPC's dialect and style of speech;
6. Production of audio using a [Lyrebird]{https://www.descript.com/overdub?lyrebird=true) style generated voice.
6. Production of audio using a [Lyrebird](https://www.descript.com/overdub?lyrebird=true) style generated voice.
As I've argued before, the game engine necessarily knows everything about the lore, and the current state, of the game world. It would be possible for any non-player character to answer literally any question about the game world, from who was mayor of Night City in 2020 to who lives in the apartment one floor up from yours, to what the weather is like in North Oaks just now.
What individual characters know should, of course, be more limited. People who live in Japantown or Heywood are unlikely to know who lives in a particular apartment in Watson; only real old timers, like Rogue, are likely to remember who was mayor fifty years ago. That's the reason for filtering; but the filtering really isn't a big deal.
Again, the generation of distinct voices for hundreds of non-player characters isn't any longer a big deal. Distinct social groups -- the corpos, and the different gangs such as Maelstrom or the Mox, will have their own argot, their own slang, their own habitual figures of speech which can be encoded into template libraries, while technologies like Lyrebird can produce an infinite range of realistic-sounding voices.
Again, the generation of distinct voices for hundreds of non-player characters isn't any longer a big deal. Distinct social groups — the corpos, and the different gangs such as Maelstrom or the Mox, will have their own argot, their own slang, their own habitual figures of speech which can be encoded into template libraries, while technologies like Lyrebird can produce an infinite range of realistic-sounding voices.
In particular, they can mimic real voices. They can mimic the voices of real actors. They can mimic [Keanu Reeves](https://cyberpunk.fandom.com/wiki/Keanu_Reeves).
In particular, they can mimic real voices. They can mimic the voices of real actors. They can mimic [Keanu Reeves](https://cyberpunk.fandom.com/wiki/Keanu_Reeves). (Interestingly, since I first wrote this note, CD Projekt Red have used Lyrebird-like technology to [resurrect a voice actor](https://www.theverge.com/2023/10/13/23915535/cyberpunk-2077-phantom-liberty-polish-voice-actor-ai-ripperdock-viktor-vektor) in Phantom Liberty, proving that the technology is good enough).
So: how do you integrate this free form 'you can say anything to any character' style of play with scripted plot?
Obviously, my vision -- as I've set out in [Organic Quests](Organic_Quests.md) -- is that many quests should emerge organically from modelling the lives, activities and motivations of non-player characters. But that's a radical vision and not one you can really expect many people to buy into until it has been demonstrated to work. I think that investors are still going to want to have confidence that there's something exciting in the game for players to engage with, and I think directors are still going to want to tell the stories they want to tell.
Obviously, my vision — as I've set out in [Organic Quests](Organic_Quests.md) — is that many quests should emerge organically from modelling the lives, activities and motivations of non-player characters. But that's a radical vision and not one you can really expect many people to buy into until it has been demonstrated to work. I think that investors are still going to want to have confidence that there's something exciting in the game for players to engage with, and I think directors are still going to want to tell the stories they want to tell.
So if I'm to sell the idea of free-form speech interaction with characters in the game world, I need an account of how it works with scripted characters voiced by high value actors in a scripted plot. I'm picking Johnny Silverhand as a core example, here, because I think he presents particular challenges.
But I also think these challenges can be addressed very easily.
In [Cyberpunk 2077](https://www.cyberpunk.net/), the player can't just go and find Johnny Silverhand, to speak to him. On the contrary, Johnny will just appear when the script calls for him to appear, and when he does he'll always initiate conversation. When a plot NPC initiates conversation with the player, the game could show -- as it does now -- a menu of things the player can say, with the implicit promise that selecting any one of these things will at least bring an interesting response which will expand one's knowledge of that character or of the lore.
In [Cyberpunk 2077](https://www.cyberpunk.net/), the player can't just go and find Johnny Silverhand, to speak to him. On the contrary, Johnny will just appear when the script calls for him to appear, and when he does he'll always initiate conversation. When a plot NPC initiates conversation with the player, the game could show — as it does now — a menu of things the player can say, with the implicit promise that selecting any one of these things will at least bring an interesting response which will expand one's knowledge of that character or of the lore.
Just as the player does now, the player in a game with free form speech interaction could choose to say one of the things presented in the menu, and the implicit contract -- that this would lead to a new revelation, or would advance the plot -- would remain unchanged. But the player could also choose to go off script, to take the conversation in an unscripted direction, or just to end it.
Just as the player does now, the player in a game with free form speech interaction could choose to say one of the things presented in the menu, and the implicit contract — that this would lead to a new revelation, or would advance the plot — would remain unchanged. But the player could also choose to go off script, to take the conversation in an unscripted direction, or just to end it.
It should be said that in Cyberpunk 2077, unlike some other games, the player already has the choice to abruptly break off conversations, even with plot characters, so how the game handles breaking off the conversation does not need to change.
@ -41,7 +41,7 @@ Well, the first and obvious thing is to parse the unscripted response to see whe
>
> **V**: Yes, dammit.
But the second thing is to respond to the response exactly as the non-player character would if the player had initiated the conversation, using the pipeline given at the beginning of this essay. Of course, in the special case of Johnny Silverhand, he is -- at least initially -- decidedly hostile and extremely selfish, so his response will typically come at step two in the pipeline:
But the second thing is to respond to the response exactly as the non-player character would if the player had initiated the conversation, using the pipeline given at the beginning of this essay. Of course, in the special case of Johnny Silverhand, he is — at least initially — decidedly hostile and extremely selfish, so his response will typically come at step two in the pipeline:
> **V**: Hey, Johnny, what's the quickest way from here to Jig Jig Street?
>

59
doc/MVP-Roadmap.md Normal file
View file

@ -0,0 +1,59 @@
# Minimum Viable Product, and a road map
Right, I'm bogged down thinking about the immensity of what I want to build, so I'm achieving nothing. So the first thing I need to state is what the Minimum Viable Product is, and the second is to outline a rough road map which takes us forwards a few steps from the MVP.
The core idea here is to have a game world in which you can just say anything you like to game characters, and they can say sensible things back.
But actually, I know that speech to text can be reasonably effectively done; and I believe with a slightly lower degree of confidence that text to convincing speech can also be done.
I also know that the movement of a character around a convincing three dimensional representation of a world can be done, but that a great deal of effort is needed to build that world.
The minimum viable product does not need to demonstrate features which people have reasonable confidence can be done. What I need to demonstrate is the things which people haven't seen done, or haven't seen done well.
## Prototype one: the minimum viable product
The minimum viable product can have just a text adventure style interface:
> You are in the market square. It is mid morning. To the north is the guild hall; to the east there are market stalls; to the south is the residence; to the west is the bridge gate.
> There is a merchant here; there is a guardsman here.
To which the user can type (for example)
> Say to the guardsman, "Can you direct me to Master Dalwhiel's house?"
Within that interface, you should be able to interact with characters who:
1. have different levels of knowledge of the world, partly driven by their age, trade and personal history;
2. move about and exchange gossip, even when the player is not present to see/hear this;
3. have different attitudes towards the player and other characters, which will be modified by what they learn in gossip;
4. have their own hierarchies of needs, which they make plans to satisfy;
5. have homes and trades;
6. will respond to speech addressed to them by the player depending on their attitude to the player, how busy they are and their knowledge of the world; and
7. as a stretch goal, will have different dialects in which they will express their responses to the player.
There should be one or two multiple decision point quests in this world which can be resolved by talking to characters.
## Prototype two: adding organic quests
Extends prototype one only by adding [organic quests](Organic_Quests.html).
## Prototype three: voice interaction
Extends prototype two by adding speech to text, so that the player can directly talk (via a microphone) to characters, and text to speech, so that the system can voice the characters' responses.
Different characters should have different voices.
## Prototype four: performative speech
This one is hard because I'm not absolutely sure how I can do it, but I need characters' voices to convey emotion; the player needs to know from their voice whether they are angry, or frightened, or impatient, or bored.
There is a [W3C specification](https://www.w3.org/TR/speech-synthesis11/) for an XML markup for speech performance, and I can certainly generate that, but I'd need to find a text-to-speech library which could consume it. There's also a separate [specification](https://www.w3.org/TR/pronunciation-lexicon/) to associate pronunciations with lexical tokens, which is also potentially useful, especially for names.
Google has a '[Cloud Text-to-Speech](https://cloud.google.com/text-to-speech/docs/ssml)' service which understands SSML and might be good enough for a demo but is more likely just embarrassingly bad.
## Prototype five traversible world
Now, a small section of a three dimensional open world, with at this stage simple block buildings that the player cannot enter, within which the characters act out their lives.
Stretch goal, [JALI](https://www.youtube.com/watch?v=uFIxiz0jwRE)-like lip sync.

View file

@ -0,0 +1,29 @@
# The Red Company: modelling democracy and morale (unfinished)
## Background
The Great Game exists as a project on two levels. One one level, it's a framework for building algorithms to build much more vibrant, and thus enjoyable game worlds; at another level, it's about building a particular world, in which I want to tell stories.
The world in which I want to tell stories is a world which is based roughly on late bronze age to medieval Europe. It's a world in which the region known as 'The Coast' -- the southern littoral of the continent -- had been a mostly-peaceful matrideic dispersed agrarian tribal society, which had been invaded some hundreds of years past by a warrior tribe with substantially better military technology.
These warrior tribesmen have settled down as local tyrants or robber barons, parasitising on the indigenous communities, and have evolved into an aristocratic ('Ariston') class. In the meantime, a mercantile class has grown up and established important long distance overland trade routes; and significant towns (called 'cities', but of only at most a few tens of thousand inhabitants) have grown up around markets.
These mercantile cities have been under the governance of powerful aristons known as tyrranoi, and the cities under their tyrranoi have competed militarily as well as commercially for control of strategic features on trade routes, such as bridges, fords, oases, mountain passes, and so on.
In the very earliest days of the warrior invasion, the warriors themselves fought against the indigenous peoples, who had very limited military equipment and tactics. Later, as they settled into Aristons, they fought by leading feudal levies of partially-trained peasants. Over the past hundred years or so, mercenary companies have emerged of specialist, trained warriors, and because these have more fighting experience (and often better equipment) they tend to beat feudal levies. These mercenary companies are base loosely on the condottierri of fourteenth century Italy.
So more and more, tyrranoi, rather than leading their own feudal levies, instead tax their peasantry and mercantile class more and hire condottierri to fight their wars.
Mercenary companies evolve out of feudal levies, and in the period of The Great Game, are mostly owned and led by aristons who employ their soldiers by paying them a wage.
One company, the Red Company, has become essentially a workers' co-op, after its former ariston leader fled in the course of a battle which looked like an inevitable defeat (but which the company, without him, won). In this company, soldiers are paid a salary, probably lower than salaries in other companies, but also at the end of the year get a share in the profits. The soldiers are organised into squads of eight who elect their own sergeants; squads are organised into companies of eight squads, and the sergeants elect the captain; companies are organised into legions of eight companies, and the captains elect the captain-general.
However, while in combat this represents a chain of command, out of combat it is much more a delegate structure; when making significant decisions, the captains general will consult with the captains who will consult with the sergeants who will consult with the soldiers.
One of the themes of the stories I want to tell is that this more democratic structure contributes to higher morale and hence to greater military success. I could model this by just making membership of the Red Company a factor in the function which computes morale. However...
## Modelling democracy
If each individual character has a hierarchy of needs, and plans actions based on that hierarchy of needs, then they have the mechanism in place to choose which of two options better conforms to their hierarchy of needs.
This implies that soldiers are likely to vote for the people (or ideas presented by the people) they consider most competent and/or most trustworthy. Which comes back to modelling reputation; which comes back to the [gossip](the-great-game.gossip.gossip.html).

View file

@ -1,4 +1,4 @@
# Modelling trading cost and risk
# Modelling trading cost and risk (unfinished)
In a dynamic pre-firearms world with many small states and contested regions, trade is not going to be straightforward. Not only will different routes have different physical characteristics - more or less mountainous, more or fewer unbridged river crossings - they will also have different political characteristics: more of less taxed, more or less effectively policed.

26
doc/Not_my_problem.md Normal file
View file

@ -0,0 +1,26 @@
# Not my problem
## Introduction
This document is essentially a catalogue of side-tracks which I do not have to go down when implementing The Great Game. Solved problems; or problems which are common to many other games, so if I don't solve them someone else will. The object of doing this is to work down to a constrained set of problems which are genuinely things I'm trying to innovate, which I should focus on; which essentially come down to
1. Gossip
2. Reputation
3. Dynamic character motivation and action, and hence
4. Dynamic economy, and
5. Dynamic plot
6. Procedural ('genetic') buildings.
(Note that although procedural vegetation is in principle a solved problem and so I don't need to solve it, I need repeatable procedural vegetation so I need to be a bit careful about the procedural vegetation library I pick).
## Animation
I envisage a well rendered three dimensional world in which many non-player characters interact with one another and with the player character. All of my characters are either human, quadrupeds, or birds (my dragons animate like very large birds). The humans are all just human; there are infants, children, adolescents, youths, adults, elderly; there are multiple racial types — but they're all human. Systems for creating varied distinct human models exist; systems for animating them exist; systems for applying and animating clothing exist. Even systems for animating continuous speech exist.
## Rendering
Ideally I'd like a stylised, not-quite-photorealistic render, because such things age, in my opinion, better than things which do seek to be photorealistic. But actually that does not matter very much; the game won't be made or broken by its rendering. Photorealistic renders are sort of the current default, that most game engines.
## Continuous Open World
I've done a great deal of thinking about how to render a continuous open world over the years, and I think at least some of it is reasonably good; but I haven't actually written any code, and in the same time period other people have written continuous open world libraries which do work, so I'd be much better choosing an existing one.

View file

@ -1,4 +1,4 @@
# On Dying
# On Dying, and Injury
Death is the end of your story. One of the tropes in games which, for me, most breaks immersion is when you lose a fight and are presented with a screen that says 'you are dead. Do you want to reload your last save?' Life is not like that. We do not have save-states. We die.
@ -11,3 +11,17 @@ Time has passed; events in the game world have moved on. You can talk to your sa
So who are the non-enemies? It depends on context. If you have a party, and some of that party survived the fight, it's your party. Otherwise, if you're in a populated place, it's locals. If it's on a road or other route, it's passing merchants. If you're in the wilderness, a hunting party. It's a bunch of non-hostiles who might reasonably be expected to be around: that's what matters. It's about not breaking immersion.
Obviously losing a fight must have weight, it must have meaning, it must have in-game consequences; otherwise it is meaningless.
## Injury
Similarly to death, injury must have meaning. Any injury takes time to recover from. It takes a certain amount of time if you're able to rest somewhere safe, and considerably longer if you're not. If you fight while injured, you'll have less strength, less stramina, and probably also less agility. Depending where you're injured, there will be certain things you cannot do. If you fight while injured, also, your recovery time will be extended, even if you take no further injury.
Some serious injuries will lead to permanent scarring, and permanent loss of agility; you'll be just slightly slower in fights.
It should be said that [Kenshi](https://lofigames.com/) — a game I've only recently become aware of and greatly admire — handles all of this extremely well, and is worth studying.
## Reciprocity
If the player is going to depend on good samaritans for rescue after losing a fight, then there must be at least a social convention that people should assist people found injured on the wayside. Consequently, if the player fails to do this, that should in itself become a 'gossip' event which will lower the player's reputation with non-player characters.
On the other hand, helping NPCs found injured at the wayside can be another category of [organic quest](Organic_Quests.html), as a special subcategory of an escort quest.

View file

@ -0,0 +1,73 @@
# On Sex, and Sexual Violence, in Games
For me the purpose of games is to provide worlds in which players can explore moral actions, and the consequences of moral actions. Sexual violence is something that happens in the real world, and which happens, even within the real world, more frequently in areas of poor governance and open conflict; and those are areas in which there are important moral actions, and important moral consequences, so they are areas in which it is interesting to set games.
It would be ludicrous to argue 'sexual violence is wrong, therefore we should not represent it in games.' Killing people is also wrong, yet it is extremely common in games. However, sexual violence — and in particular the representation of sexual violence — does pose some specific problems that need to be addressed.
Firstly, sexual violence is extremely gendered. Yes, male people are sometimes subjected to sexual violence, but nevertheless the overwhelming majority of victims of sexual violence are female. Yes, female people are sometimes — extraordinarily rarely, but sometimes — perpetrators of sexual violence, but nevertheless perpetrators of sexual violence are almost exclusively male.
Secondly, it is extremely tricky to represent sexual violence in visual media without eroticising it. There's a [very famous scene in Last Tango in Paris](https://www.independent.co.uk/arts-entertainment/films/news/last-tango-in-paris-butter-scene-b2270513.html) which the director might claim is consented in context, but which appears to me to be a clear case of anal rape, which is nevertheless highly erotic. There's a scene in [High Plains Drifter](https://en.wikipedia.org/wiki/High_Plains_Drifter#Plot) where no part of the rape is actually represented — it happens off screen — but it is nevertheless perceived by many people (including me) as eroticised. Many people — I suspect more men than women, but certainly including many women — do find the idea of rape erotic. It seems to me highly undesirable that a game should be seen to be rewarding immoral action.
(Yes, I know many modern games do quite explicitly reward killing, including of characters whose culpability is at best trivial, but — surely — this is something we should be seeking to move away from.)
## Subtlety and Nuance
A final issue here is that sexual interactions between people are subtle, and are subtle even around issues of consent. A less powerful person (normally a woman) — alone or as a member of a weak party, a party of perhaps older people, other women, children — may submit to sex with more powerful others without protest in order to protect others in their party, or to avoid death or serious injury, or to avoid starvation, or to escape debt. Do any of these things truly count as consent?
Again, a less powerful person may submit to sex with more powerful others transactionally in return to protection, or shelter, or food, or other resources. In modern society we might see this as sex work, and we might argue that sex work falls into the same moral category as any other labour entered into transactionally. But, generally, is it moral that people should be put into a position where their survival depends on their ability to sell any sort of unwilling labour?
(This is not to deny that some people, who do have secure living conditions or who could choose to do other things in order to gain secure living conditions do choose, willingly and voluntarily, to engage in sex work; and it isn't to criticise those people in any way).
Games are not very good at subtly and nuance. When, while playing a game, the character who is our avatar in the game, who we thought we were controlling, does something which we didn't intend them to do, it's very wrenching and immersion-breaking.
At the same time, if other characters in the game interpret something the player's character has done as sexual violence when the player did not intend sexual violence, that's also undesirable.
So, questions:
## Sex between non-player characters
People have sex. If people didn't have sex, there wouldn't be people; but more, if people didn't have sex, there wouldn't be (many) stories, since most stories are driven at least in part by sex. So pretending that non-player characters don't have sex is worse than unrealistic.
We live in a pathologically repressed society, in which open sex — sex in public places, sex with other people present — is rare, is seen as deviant, is (perhaps in consequence) highly eroticised. Does that mean that all the societies we represent in our games must be similarly repressed?
I would argue strongly to the contrary. Games are environments in which we can explore moral possibilities, and a society in which public sexuality was normal is clearly a possibility. Would such a society be a better society? Games are a mechanism through which we can ask that question, and questions of that sort.
If we're going to represent a society in which public sex is normal, then we're going to have to represent public sex on screen. It can take one of many forms:
1. Sex as normal activity — it's just going on in the background, and no other non-player characters pay much attention;
2. Sex as conscious performance — sex where the participants intend to be watched, and other non-player characters do pay attention (this may include consciously eroticised performance);
3. Sex as part of a religious or other ritual event — this is related to, and is, sex as conscious performance, but the purpose of the performance is symbolic and/or sacramental. This doesn't mean it is not eroticised, but it may not be eroticised.
By 'eroticised', I'm meaning deliberately intended to trigger sexual feelings in the audience — which, if the player character is present, includes the player.
## Sexual violence between non-player characters
In a world in which there are characters who are thuggish, who seek to dominate, terrorise and subdue other characters, whether those characters are outlaws or soldiers or aristocrats, to pretend that rape would not be used as a means to dominate, terrorise or subdue is… bowdlerisation. It's unrealistic, and it's a morally indefensible choice.
So there has to be a mechanism for non-player characters to decide to commit acts of sexual violence towards other non-player characters. The player must at least hear of such events through the gossip network, and should be able to find the specific non-player characters involved, and speak to them. Whether it's necessary to portray acts of sexual violence on screen is something I'm much less persuaded by, simply because it runs the risk of eroticising them.
## Mutually consented sexual activity between the player character and non-player characters
Mutually consented sexual behaviour between the player character and (certain, scripted) non-player characters has been a feature of video games for some time, and has occasionally been portrayed with real sensitivity and eroticism. Two cases I would point to are
1. The sex scene between Geralt and Shani in The Witcher;
2. The sex scene between V and Judy in Cyberpunk 2077.
Cyberpunk is a largely non-cutscene game, but the sex scenes is a cutscenes and I completely understand why, from a technical point of view: the player does not have, either with mouse and keyboard or with a game controller, nearly enough control over their character to convey the subtlety and nuance of a good sex scene. Sex scenes in most video games are also pretty rare, and that must be at least partly because of cultural prurience.
But if a game allows a player to have a long lasting, narratively sexual relationship with a non-player character, as many games do, then sex is a behaviour which may happen repeatedly, and just playing the same cutscene over and over again is not going to be an adequate way of representing that.
The ideal would be to have a moderately large library of brief motion captures of people authentically having sex, and to be able to select performances at random from that library to apply to the body models of the characters who in the game are having sex, whether that be the player character with a non-player character, or two non-player characters. In the case where the player character is involved, this would happen in the location where the player chose to initiate it, so it wouldn't be a cutscene in the normal sense; but I think that the controller should be disabled for the duration of the performance.
## Sexual violence by one non-player character towards another
This is at least implicitly represented in existing video games, and while caution about eroticising it should be maintained, I think it's something which should be narratively possible.
## Sexual violence from the player character towards non-player characters
This would be extremely tricky (and controversial!) to handle; I *think* it ought to be in the narrative toolkit, but I have no specification to offer just now.
## Sexual violence from a non-player character towards the player character
Even trickier!

View file

@ -2,11 +2,11 @@
**NOTE**: this file is called 'pathmaking', not 'pathfinding', because 'pathfinding' has a very specific meaning/usage in game design which is only part of what I want to talk about here.
**NOTE**: Work on this is being carried on in a separate library, [Walkmap](https://github.com/simon-brooke/walkmap), q.v.
## Stages in creating routes between locations
### The 'procedural' phase
*see also [[Baking-the-world]]*
*see also [Baking the world](Baking-the-world.html)*
Towards the end of the procedural phase of the build process, every agent within the game world must move through the complete range of their needs-driven repertoire. Merchants must traverse their trading routes; soldiers must patrol routes within their employers domain; primary producers and craftspeople must visit the craftspeople who supply them; every character must visit their local inn, and must move daily between their dwelling and their workplace if different; and so on. They must do this over a considerable period - say 365 simulated days.
@ -16,17 +16,55 @@ The algorithmic part of choosing a route is the same during this baking phase as
Thus the 'weight' of any section of route is a function of the total number of times that route segment has been traversed by an agent during this baking phase. At the end of the baking phase, routes travelled more than `R` times are rendered as roads, `T` times as tracks, and `P` times as footpaths, where `R`, `T` and `P` are all chosen by the game designer but generally `R > T > P`.
### Algorithmic rules
### Routing
1. No route may pass through any part of a reserved holding, except the holding which is its origin, if any, and the holding which is its destination (and in any case we won't render paths or roads within holdings, although traversal information may be used to determine whether a holding, or part of it, is paved/cobbled;
Routing is fundamentally by [A\*](https://www.redblobgames.com/pathfinding/a-star/introduction.html), I think.
#### Algorithmic rules
1. No route may pass through any part of a reserved holding, except the holding which is its origin, if any, and the holding which is its destination, if any (and in any case we won't render paths or roads within holdings, although traversal information may be used to determine whether a holding, or part of it, is paved/cobbled;
2. No route may pass through any building, with the exception of a city gate;
3. We don't have bicycles: going uphill costs work, and you don't get that cost back on the down hill. Indeed, downhills are at least as expensive to traverse as flat ground;
4. Any existing route segment costs only a third as much to traverse as open ground having the same gradient;
5. A more used route costs less to traverse than a less used route.
#### Step costing:
Step cost is something like:
(/
(-
(+ distance
(expt height-gained height-gain-exponent)
(reduce + (map crossing-penalty watercourses-crossed)))
(reduce + (map bridge-bonus bridges-crossed)))
(or road-bonus 1))
**Where**
* `distance` traversed is in metres;
* `height-gained` is in metres;
* `height-gain-exponent` is tunable;
* river `crossing-penalty` varies with a (tunable) exponent of the flow;
* `bridge-bonus` works as follows: bridge bonus for a bridge entirely cancels the river crossing penalty
for the watercourse the bridge crosses; bridge bonus for a ferry cancels a (tunable) fraction the river
crossing penalty.
* road-bonus for a road is substantial - probably about 8; for a track is less than road but greater than footpath, say 5; for a footpath has to be at least 3, to provide an incentive to
stick to paths. All these values are tunable. Road bonus ought also to increase a small amount with each traversal of the path segment, but that's still to be worked on.
A lot of this is subject to tuning once we have prototype code running.
Somewhere into all this I need to factor tolls charged by local aristons,
especially for bridges/ferries, and risk factors of hostile action, whether
by outlaws or by hostile factions. But actually, that is at a per actor
level, rather than at a pathmaking level: richer actors are less deterred
by tolls, better armed actors less deterred by threat of hostile action.
### River crossings
Crossing rivers is expensive - say five times as expensive as level open ground (but this will probably need tuning). Where a river is shallow enough, (i.e. where the amount of water passing is below some threshold) then a path crossing will be rendered as stepping stones and a track crossing as a ford. Where it's deeper than that, a path crossing either isn't rendered at all or is rendered as a light footbridge. A track or road crossing is rendered as a bridge. However, the maximum length of a bridge varies with the amount of traffic on the route segment, and if the crossing exceeds that length then a ferry is used. Road bridges will be more substantial than track bridges, for example in a biome with both timber and stone available road bridges might be rendered as stone bridges while track bridges were rendered as timber. If the watercourse is marked as `navigable`, the bridge must have a lifting section. It is assumed here that bridges are genetic buildings like most other in-game buildings, and so don't need to be individually designed.
River crossings appear automatically when the number of traversals of a particular route across a watercourse passes some threshhold. The threshold probably varies with an exponent of the flow; the threshold at which a ferry will appear is lower (by half?) than the threshold for a bridge. Of course river crossings, like roads, can also be pre-designed by game designers.
Where a river is shallow enough, (i.e. where the flow is below some threshold) then a path crossing will be rendered as stepping stones and a track crossing as a ford. Where it's deeper than that, a path crossing either isn't rendered at all or is rendered as a light footbridge. A track or road crossing is rendered as a bridge. However, the maximum length of a bridge varies with the amount of traffic on the route segment, and if the crossing exceeds that length then a ferry is used. Road bridges will be more substantial than track bridges, for example in a biome with both timber and stone available road bridges might be rendered as stone bridges while track bridges were rendered as timber. If the watercourse is marked as `navigable`, the bridge must have a lifting section. It is assumed here that bridges are genetic buildings like most other in-game buildings, and so don't need to be individually designed.
### Representation
@ -65,17 +103,7 @@ I'm working on a separate library, [walkmap](https://simon-brooke.github.io/walk
### Pathmaking and scale
Dealing with large heightmaps - doing anything at all with them - is extremely compute intensive. Just converting a 1000x1000 heightmap from STL to SVG is currently taking 8 hours and 15 minutes; and it ends up with a 46 megabyte SVG file! However, most of the time cost is in writing. Reading the STL file takes four and a quarter seconds; converting that STL to SVG in memory takes less than five seconds. So the huge cost is writing the file with Dali.
walkmap.core=> (time (def stl (decode-binary-stl "../the-great-game/resources/maps/heightmap.stl")))
"Elapsed time: 4285.231513 msecs"
#'walkmap.core/stl
walkmap.core=> (time (def svg (stl-to-svg stl)))
"Elapsed time: 4865.798059 msecs"
#'walkmap.core/svg
"Elapsed time: 2.969569560662E7 msecs"
Dealing with large heightmaps - doing anything at all with them - is extremely compute intensive.
We cannot effectively do routing at metre scale - which is what we ultimately need in settlements - across the entire thousand kilometre square map in one pass. But also we don't need to because much of the continent is by design relatively unpeopled and relatively untracked. The basic concept of the Steppe is that there are two north/south routes, the one over the Midnight Pass into the Great Place and the one via Hans'hua down to the Cities of the Coast, and those can be part of the 'designed roads' map. So we can basically exclude most of the Steppe from routing altogether. We can also - for equally obvious reasons exclude the ocean. The ocean makes up roughly half of the 1000x1000 kilometre map, the steppe and plateau take up half of what's left, mountain massifs eat into the remainder and my feeling is that much of the eastern part of the continent is probably too arid to be settled. So we probably end up only having to dynamically route about 20% of the entire map.
@ -107,6 +135,10 @@ we can then collect contiguous groups of zones each having at least one holding,
At least one of phases three, four, five and six is probably redundant; but without trying I'm not sure which.
#### Relevant actor classes by phase
Craftspeople and primary producers do travel between settlements, but only exceptionally. They mainly travel within at most a few kilometres of home; so they are primarily relevant in phases four and five, and need not be activated during phase six. Similarly, merchants primarily travel between settlements, and rarely within settlements; therefore, they need not be activated in phase four, and probably not even in phase five; but they must do a lot of journeys - substantially their full repertoire - in phase six.
### Tidying up
After the full set of increasing-scale passes is complete, we should automatically cull any route segments generated in the settlement phase which have never actually been traversed.

View file

@ -2,7 +2,7 @@
#### Saturday, 6 July 2013
*(You might want to read this essay in conjunction with my older essay, [Settling a game world](../../2009/12/settling-game-world.html), which covers similar ground but which this hopefully advances on)*
*(You might want to read this essay in conjunction with my older essay, [Settling a game world](Settling-a-game-world.html), which covers similar ground but which this hopefully advances on)*
For an economy to work people have to be able to move between occupations to fill economic niches. In steady state, non player character (NPC) males become adult as 'vagrants', and then move through the state transitions described in this document. The pattern for females is different.
@ -12,7 +12,7 @@
| Occupation | Dwelling | condition | New trade | Notes |
| Occupation | Dwelling | Condition | New trade | Notes |
| --- | --- | --- | --- | --- |
| Vagrant | None | land available and animals available | Herdsman | |
| Vagrant | None | arable land available | Farmer | See crops |
@ -43,70 +43,81 @@
Crafts are occupations which require acquired skills. In the initial seeding of the game world there are probably 'pioneers', who are special vagrants who, on encountering the conditions for a particular craft to thrive, instantly become masters of that craft.
<table>
<tr>
<th rowspan="3"> Craft <th rowspan="3"> Dwelling <th rowspan="3"> Supplies <th rowspan="3"> Perishable? <th rowspan="3"> Customer types <th rowspan="3"> Needs market? <th colspan="6"> Customers <th rowspan="3"> Supplier <th rowspan="3"> Suppliers <th rowspan="3"> Recruits </th></tr>
<tr><th colspan="2"> Solo <th colspan="2"> Per journeyman <th colspan="2"> Per apprentice</tr>
<tr><th> Min <th> Max <th> Min <th> Max <th> Min <th> Max </tr>
<tr><td>Smith <td>Forge <td>Metal Items <td>no <td>Farmer, Soldier <td>No <td>6 <td>10 <td>4 <td>6 <td>1 <td>3 <td>Miner <td>1 <td>Vagrant
<tr><td>Baker <td>Bakery <td>Bread <td>yes <td>All NPCs <td>No <td>20 <td>30 <td>12 <td>18 <td>6 <td>10 <td>Miller <td>1 <td>Vagrant
<tr><td>Miller <td>Mill <td>Flour, meal <td>no <td>Baker, Innkeeper <td>No <td>2 <td>3 <td>1 <td>2 <td>1 <td>1 <td>Farmer <td>6 <td>Vagrant
<tr><td>Weaver <td>Weaver's house <td>Cloth <td>no <td>All NPCs <td>Yes <td>6 <td>10 <td>4 <td>6 <td>1 <td>3 <td>Herdsman <td>2 <td>Vagrant
<tr><td>Innkeeper <td>Inn <td>Food, hospitality <td>yes <td>Merhant, Soldier, Farmer, Lord <td>No <td>10 <td>20 <td>5 <td>10 <td>2 <td>4 <td>Farmer,Herdsman <td>2 <td>Vagrant
<tr><td>Miner <td>Mine <td>Ores <td>no <td>Smith <td>Yes <td>2 <td>3 <td>1 <td>2 <td>1 <td>1 <td>Farmer <td>1 <td>Vagrant
<tr><td>Butcher <td>Butchery <td>Meat <td>yes <td>All NPCs <td>No <td>10 <td>20 <td>4 <td>8 <td>2 <td>4 <td>Farmer, Herdsman <td>2 <td>Vagrant
<tr><td>Merchant <td>Townhouse <td>Transport, logistics <td>n/a <td>Craftsmen, nobility <td>Yes <td>10 <td>20 <td>4 <td>8 <td>2 <td>4 <td>n/a <td>n/a <td>Vagrant
<tr><td>Banker <td>Bank <td>Financial services <td>yes <td>Merchant <td>Yes <td>10 <td>20 <td>4 <td>8 <td>2 <td>4 <td>n/a <td>n/a <td>Merchant
<tr><td>Scholar <td>Academy <td>Knowledge <td>n/a <td>Ariston, Tyrranos, General, Banker <td>No <td>1 <td>4 <td>1 <td>2 <td>0.25 <td>0.5 <td>n/a <td>n/a <td>Vagrant
<tr><td>Priest <td>Temple <td>Religion <td>n/a <td>All NPCs <td>No <td>50 <td>100 <td> <td> <td> <td> <td> <td> <td>Scholar
<tr><td>Chancellor <td>Chancellory <td>Administration <td>n/a <td>Ariston, Tyrranos <td>No <td>1 <td>1 <td>0 <td>0 <td>0 <td>0 <td> <td> <td>Scholar
<tr><td>Lawyer <td>Townhouse <td>Legal services <td>n/a <td>Ariston, Merchant, Banker <td>No <td>4 <td>6 <td>2 <td>3 <td>1 <td>2 <td> <td> <td>Scholar
<tr><td>Magus <td>Townhouse <td>Magic <td>n/a <td>Tyrranos, General <td>No <td>3 <td>4 <td>1 <td>2 <td>0.25 <td>0.5 <td> <td> <td>Scholar
</table>
| Craft | Dwelling | Supplies | Perishable? | Customer types | Needs market? | Customers | Supplier | Suppliers | Recruits |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| | | | | | | Solo | Per journeyman | Per apprentice | | | |
| | | | | | | --- | --- | --- | | | |
| | | | | | | Min | Max | Min | Max | Min | Max | | | |
| --- | | | | | | --- | --- | --- | --- | --- | --- | | | |
| Smith | Forge | Metal Items | no | Farmer, Soldier | No | 6 | 10 | 4 | 6 | 1 | 3 | Miner | 1 | Vagrant |
| Baker | Bakery | Bread | yes | All NPCs | No | 20 | 30 | 12 | 18 | 6 | 10 | Miller | 1 | Vagrant |
| Miller | Mill | Flour, meal | no | Baker, Innkeeper | No | 2 | 3 | 1 | 2 | 1 | 1 | Farmer | 6 | Vagrant |
| Weaver | Weaver's house | Cloth | no | All NPCs | Yes | 6 | 10 | 4 | 6 | 1 | 3 | Herdsman | 2 | Vagrant |
| Innkeeper | Inn | Food, hospitality | yes | Merhant, Soldier, Farmer, Lord | No | 10 | 20 | 5 | 10 | 2 | 4 | Farmer,Herdsman | 2 | Vagrant |
| Miner | Mine | Ores | no | Smith | Yes | 2 | 3 | 1 | 2 | 1 | 1 | Farmer | 1 | Vagrant |
| Butcher | Butchery | Meat | yes | All NPCs | No | 10 | 20 | 4 | 8 | 2 | 4 | Farmer, Herdsman | 2 | Vagrant |
| Merchant | Townhouse | Transport, logistics | n/a | Craftsmen, nobility | Yes | 10 | 20 | 4 | 8 | 2 | 4 | n/a | n/a | Vagrant |
| Banker | Bank | Financial services | yes | Merchant | Yes | 10 | 20 | 4 | 8 | 2 | 4 | n/a | n/a | Merchant |
| Scholar | Academy | Knowledge | n/a | Ariston, Tyrranos, General, Banker | No | 1 | 4 | 1 | 2 | 0.25 | 0.5 | n/a | n/a | Vagrant |
| Priest | Temple | Religion | n/a | All NPCs | No | 50 | 100 | | | | | | | Scholar |
| Chancellor | Chancellory | Administration | n/a | Ariston, Tyrranos | No | 1 | 1 | 0 | 0 | 0 | 0 | | | Scholar |
| Lawyer | Townhouse | Legal services | n/a | Ariston, Merchant, Banker | No | 4 | 6 | 2 | 3 | 1 | 2 | | | Scholar |
| Magus | Townhouse | Magic | n/a | Tyrranos, General | No | 3 | 4 | 1 | 2 | 0.25 | 0.5 | | | Scholar |
A craftsman starts as an apprentice to a master of the chosen crafts. Most crafts recruit from vagrants, A character must be a journeyman merchant before becoming an apprentice banker, while various intellectual crafts recruit from journeyman scholars.
It's assumed that a journeyman scholar, presented with the opportunity, would prefer to become an apprentice magus than a master scholar.
A craftsman starts as an apprentice to a master of the chosen crafts. Most crafts recruit from vagrants, A character must be a journeyman merchant before becoming an apprentice banker, while various intellectual crafts recruit from journeyman scholars.
### Related crafts
It's assumed that a journeyman scholar, presented with the opportunity, would prefer to become an apprentice magus than a master scholar.
There are groups of crafts which should probably be seen as related crafts, where apprenticeship in one should serve as qualification to serve as journeyman in another. For example, there is a family of woodworking crafts, whose base is probably `Joiner`.
A journeyman settles and becomes a master when he finds a location with at least the solo/min number of appropriate customer type who are not serviced by another master craftsman of the same craft; he also (obviously) needs to find enough free land to set up his dwelling. The radius within which his serviced customers must live may be a fixed 10Km or it may be variable dependent on craft. If there are unserviced customers within his service radius, the master craftsman may take on apprentices and journeymen to service the additional customers up to a fixed limit perhaps a maximum of four of each, perhaps variable by craft. If the number of customers falls, the master craftsman will first dismiss journeymen, and only in desperate circumstances dismiss apprentices. Every apprentice becomes a journeyman after three years service.
Crafts within this family include
The list of crafts given here is illustrative, not necessarily exhaustive.
* Boatwright
* Cabinetmaker
* Cartwright
* Cooper
* Lutanist
* Military Artificer
* Millwright
* Turner
So although I think these are separate crafts, all are Joiners; all can undertake construction joinery work; and a journeyman who has served as apprentice to any can serve as journeyman to any other. Since journeymen will typically serve under more than one master before settling down, it will be possible for one person to have served under masters in two different related trades and therefore be qualified to set up as a master of either.
A journeyman settles and becomes a master when he finds a location with at least the solo/min number of appropriate customer type who are not serviced by another master craftsman of the same craft; he also (obviously) needs to find enough free land to set up his dwelling. The radius within which his serviced customers must live may be a fixed 10Km or it may be variable dependent on craft. If there are unserviced customers within his service radius, the master craftsman may take on apprentices and journeymen to service the additional customers up to a fixed limit perhaps a maximum of four of each, perhaps variable by craft. If the number of customers falls, the master craftsman will first dismiss journeymen, and only in desperate circumstances dismiss apprentices. Every apprentice becomes a journeyman after three years service.
The list of crafts given here is illustrative, not necessarily exhaustive.
## Aristocracy
As in the real world, aristocracy is essentially a protection racket, and all nobles are originally outlaw leaders who found an area with rich pickings and settled down.
As in the real world, aristocracy is essentially a protection racket, and all nobles are originally outlaw leaders who found an area with rich pickings and settled down.
<table>
<tr><th rowspan="2"> Rank <th rowspan="2"> Follower rank <th rowspan="2"> Client type <th colspan="2"> Clients protected <th colspan="2"> Trade in market <th colspan="2"> Followers per client
<tr><th> Min <th> Max <th> Min <th> Max <th> Min <th> Max
<tr><td>Bonnet Laird <td>Private <td>Farmer <td>6 <td>20 <td>0 <td>100 <td>0.25 <td>0.5
<tr><td>Ariston <td>Captain <td>Bonnet Laird <td>10 <td>30 <td>25 <td>1000 <td>0.5 <td>1
<tr><td>Tyrranos <td>General <td>Ariston <td>10 <td>unlimited <td>250 <td>unlimited <td>0.1 <td>0.5
</table>
| Rank | Follower rank | Client type | Clients protected | Trade in market | Followers per client |
| --- | --- | --- | --- | --- | --- |
| | | | Min | Max | Min | Max | Min | Max |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Bonnet Laird | Private | Farmer | 6 | 20 | 0 | 100 | 0.25 | 0.5 |
| Ariston | Captain | Bonnet Laird | 10 | 30 | 25 | 1000 | 0.5 | 1 |
| Tyrranos | General | Ariston | 10 | unlimited | 250 | unlimited | 0.1 | 0.5 |
Every noble establishes a market and, if he employs a chancellor, taxes trade in it. Crafts which 'need a market' can only be established in the vicinity of a market, irrespective of whether there are sufficient customers elsewhere. All non-perishable goods are traded through the markets, and merchants will transfer surpluses between markets if they can make a profit from it.
My world has essentially three ranks of nobility. The title of the lowest rank will probably change to something vaguely italianate. An aristocrat advances to the next rank when either the requisite number of clients become available in the locality to support the next rank, or the trade in his market becomes sufficient to support the next rank.
Every noble establishes a market and, if he employs a chancellor, taxes trade in it. Crafts which 'need a market' can only be established in the vicinity of a market, irrespective of whether there are sufficient customers elsewhere. All non-perishable goods are traded through the markets, and merchants will transfer surpluses between markets if they can make a profit from it.
My world has essentially three ranks of nobility. The title of the lowest rank will probably change to something vaguely italianate. An aristocrat advances to the next rank when either the requisite number of clients become available in the locality to support the next rank, or the trade in his market becomes sufficient to support the next rank.
Obviously when a province has eleven unprotected bonnet lairds, under the rules given above any of them may become the ariston, and essentially it will be the next one to move after the condition becomes true. If the number of available clients drops below the minimum and the market trade also drops below the minimum, the noble sinks to a lower level in the case of the bonnet laird, to outlaw leader.
Obviously when a province has eleven unprotected bonnet lairds, under the rules given above any of them may become the ariston, and essentially it will be the next one to move after the condition becomes true. If the number of available clients drops below the minimum and the market trade also drops below the minimum, the noble sinks to a lower level in the case of the bonnet laird, to outlaw leader.
## Military
The aristocracy is supported by the military. An outlaw becomes a soldier when his leader becomes a noble. Otherwise, vagrants are recruited as soldiers by bonnet lairds or sergeants who have vacancies. Captains are recruited similarly by aristons or generals, and generals are recruited by tyrranos. If the conditions for employment no longer exist, a soldier is allowed a period of unemployment while he lives off savings and finds another employer, but if no employer is found he will eventually become an outlaw (or, if an officer, an outlaw leader). A private is employed by his sergeant or bonnet laird, a sergeant by his captain, a captain by his arison or general, a general by his tyrranos.
The aristocracy is supported by the military. An outlaw becomes a soldier when his leader becomes a noble. Otherwise, vagrants are recruited as soldiers by bonnet lairds or sergeants who have vacancies. Captains are recruited similarly by aristons or generals, and generals are recruited by tyrranos. If the conditions for employment no longer exist, a soldier is allowed a period of unemployment while he lives off savings and finds another employer, but if no employer is found he will eventually become an outlaw (or, if an officer, an outlaw leader). A private is employed by his sergeant or bonnet laird, a sergeant by his captain, a captain by his arison or general, a general by his tyrranos.
<table>
<tr><th rowspan="2"> Rank <th rowspan="2"> Follower rank <th colspan="2"> Followers <th rowspan="2"> Condition <th rowspan="2"> New rank
<tr><th> Min <th> Max
<tr><td>Private <td>None <td>0 <td>0 <td>Battle hardened, unled privates <td>Sergeant
<tr><td>Sergeant <td>Private <td>5 <td>15 <td>More battle hardened, unled sergeantts <td>Captain
<tr><td>Captain <td>Sergeant <td>5 <td>15 <td>More battle hardened, unled captains <td>General
<tr><td>General <td>Captain <td>5 <td>unlimited <td> <td>
</table>
| Rank | Follower rank | Followers | | Condition | New rank |
| --- | --- | --- | --- | --- | --- |
| | | Min | Max | | |
| --- | --- | --- | --- | --- | --- |
| Private | None | 0 | 0 | Battle hardened, unled privates | Sergeant |
| Sergeant | Private | 5 | 15 | More battle hardened, unled sergeantts | Captain |
| Captain | Sergeant | 5 | 15 | More battle hardened, unled captains | General |
| General | Captain | 5 | unlimited | | |
Soldiers have no loyalty to their employer's employer.
Soldiers have no loyalty to their employer's employer.

30
doc/Roadmap.md Normal file
View file

@ -0,0 +1,30 @@
# Roadmap (obsolete)
This document outlines a plan to move forward from where I am in June 2021.
**NOTE**: this document has been [superceded](MVP-Roadmap.html).
# JMonkeyEngine
[JMonkeyEngine](https://jmonkeyengine.org/) is not, at this time, an AAA game engine. But at the same time I'm never, really, going to build an AAA game. It is a working game engine which can display characters on screen in scenery and have them move around, and, actually, they can be fairly sophisticated. It will be resaonably easy to integrate Clojure code with JMonkeyEngine - easier than it would be to integrate either Clojure or Common Lisp with [Unreal Engine](https://www.unrealengine.com/) or [Unity 3D](https://unity.com/). As a significant added bonus, JMonkeyEngine is open source.
Consequently I plan to stop agonising about what game engine to use, and seriously focus on getting something working in JMonkeyEngine.
# Not Reinventing Wheels
JMonkeyEngine already has working code for walking animated characters, which is entirely adequate to proof-of-concept what I want to do. Rather than try to implement them myself, I just intend to use existing JMonkeyEngine code as far as possible.
# The 1Km World
I propose to build a 1Km square world, containing one settlement, as a proof of concept for
1. Procedural (genetic) buildings;
2. Procedural settlement planning;
3. Procedural characters, probably based on [MakeHuman 'Mass Produce' plugin](https://youtu.be/jRHnJX-TdT4), using walk animation based on [TestWalkingChar](https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java);
4. Characters with their own hierarchy of needs, and their own means of planning to fulfil these;
5. Characters with individualised knowledge about the world;
6. Characters who can parse typed questions, and produce either a textual or audio response;
7. Characters with procedurally generated accents (very stretch goal)!
8. Characters who can listen to spoken questions, and produce audio responses.
At that stage, I have a technology demonstrator that will be interesting. It still leaves the big procedural world builder still to do, but it would be enough technology to get other people interested in the project.

View file

@ -35,7 +35,7 @@ The next tier of playable roles rotates around issues arising from the mercantil
### Aristocracy
Aristocrats are basically settled outlaws who seek to establish a monopoly on extracting taxes from inhabitants and travellers in a particular region by driving out all other outlaws. Within the comain of an aristocrat, you have to pay tax but you're reasonably safe from being attacked by other outlaws and losing everything. Aristocrats may also maintain and improve roads and bridges and do other things to boost the economy of their territory, may expant into adjoining territory with no current aristocratic control, and may wage war on other aristocrats.
Aristocrats are basically settled outlaws who seek to establish a monopoly on extracting taxes from inhabitants and travellers in a particular region by driving out all other outlaws. Within the domain of an aristocrat, you have to pay tax but you're reasonably safe from being attacked by other outlaws and losing everything. Aristocrats may also maintain and improve roads and bridges and do other things to boost the economy of their territory, may expand into adjoining territory with no current aristocratic control, and may wage war on other aristocrats.
An outlaw ought to be able to become an aristocrat, by dominating an ungoverned area or by defeating an existing aristocrat.
@ -45,22 +45,24 @@ Soldiers, like aristocrats, are basically on the same spectrum as outlaws. Outla
## Routine, Discretion and Playability
There's a term that's used in criticism of many computer games which is worth thinking about hard here: that term is 'farming'. 'Farming', in this sense, is doing something repetitive and dull to earn credits in a game. Generally this is not fun. What makes roles in a game-world fun is having individual discretion - the ability to choose between actions and strategies - and a lack of routine.
There's a term that's used in criticism of many computer games which is worth thinking about hard here: that term is 'farming'. 'Farming', in this sense, is doing something repetitive and dull to earn credits in a game. Generally this is not fun. What makes roles in a game-world fun is having individual discretion &mdash; the ability to choose between actions and strategies &mdash; and a lack of routine.
Most craft skills - especially in the learning phase - are not like this, and crafts which are sophisticated enough to be actually engaging are very hard to model in a game. Learning a craft is essentially, inherently, repetitive and dull, and if you take that repetition out of it you probably don't have enough left to yield the feeling of mastery which would reward success; so it doesn't seem to me that making craft roles playable should be a priority.
Most craft skills &mdash; especially in the learning phase &mdash; are not like this, and crafts which are sophisticated enough to be actually engaging are very hard to model in a game. Learning a craft is essentially, inherently, repetitive and dull, and if you take that repetition out of it you probably don't have enough left to yield the feeling of mastery which would reward success; so it doesn't seem to me that making craft roles playable should be a priority.
## Cruise control
One of the most enjoyable aspects of The Witcher 3 - still my go-to game for ideas I want to improve on - is simply travelling through the world. Although fast travel is possible I find I rarely use it, and a journey which takes fifteen minutes of real world wall clock time can be enjoyable in and of itself. This is, of course, a credit to the beautiful way the world is realised.
One of the most enjoyable aspects of The Witcher 3 &mdash; still my go-to game for ideas I want to improve on &mdash; is simply travelling through the world. Although fast travel is possible I find I rarely use it, and a journey which takes fifteen minutes of real world wall clock time can be enjoyable in and of itself. This is, of course, a credit to the beautiful way the world is realised.
But nevertheless, in The Witcher 3, a decision was made to pack incident fairly densely - because players would find just travelling boring. This leads to a situation where peaceful villages exist two minutes travel from dangerous monsters or bandit camps, and the suspension of disbelief gets a little strained. Building a world big enough that a market simulation is believable means that for the individual, the travel time to a market where a particular desired good is likely to be cheaper becomes costly in itself. Otherwise, there's no arbitrage between markets and no ecological niche for a merchant to fill. The journey time from market to market has to be several in-game days.
(It's worth noting that [Kenshi](https://lofigames.com/), a game I'm coming to greatly admire, does not allow fast travel at all, but has an equivalent of 'cruise control' &mdash; you can set a destination and then accelerate time and simply watch as your characters journey).
An in-game day doesn't have to be as long as a wall clock day, and, indeed, typically isn't. But nevertheless, doing several game days of incident-free travel, even in beautiful scenery, is not going to be engaging - which implies a fast-travel mechanic.
But nevertheless, in The Witcher 3, a decision was made to pack incident fairly densely &mdash; because players would find just travelling boring. This leads to a situation where peaceful villages exist two minutes travel from dangerous monsters or bandit camps, and the suspension of disbelief gets a little strained. Building a world big enough that a market simulation is believable means that for the individual, the travel time to a market where a particular desired good is likely to be cheaper becomes costly in itself. Otherwise, there's no arbitrage between markets and no ecological niche for a merchant to fill. The journey time from market to market has to be several in-game days.
I don't like fast travel, I find it a too-obvious breaking of immersion. Also, of course, one of the interesting things about a game in a merchant/outlaw ecosystem is the risk of interception on a journey. The Dragon Age series handled interrupted travel in 'fast travel' by randomly interrupting the loading screen you get when moving from location to location in Dragon Age's patchwork worlds by dumping you into a tiny arena with enemies. That's really, really bad - there's no other way to say this. Everything about it shouts artifice.
An in-game day doesn't have to be as long as a wall clock day, and, indeed, typically isn't. But nevertheless, doing several game days of incident-free travel, even in beautiful scenery, is not going to be engaging &mdash; which implies a fast-travel mechanic.
I don't like fast travel, I find it a too-obvious breaking of immersion. Also, of course, one of the interesting things about a game in a merchant/outlaw ecosystem is the risk of interception on a journey. The Dragon Age series handled interrupted travel in 'fast travel' by randomly interrupting the loading screen you get when moving from location to location in Dragon Age's patchwork worlds by dumping you into a tiny arena with enemies. That's really, really bad &mdash; there's no other way to say this. Everything about it shouts artifice.
So I'm thinking of a different mechanism: one I'm calling cruise control.
You set out on a task which will take a long time - such as a journey, but also such as any routine task. You're shown either a 'fast forward' of your character carrying out this task, or a series of cinematic 'shots along the way'. This depends, of course, on there being continuous renderable landscape between your departure and your destination, but there will be. This fast-forward proceeds at a substantially higher time gearing than normal game time - ten times as fast perhaps; we need it to, because as well as doing backgound scenery loading to move from one location to another, we're also simulating lots of non-player agents' actions in parts of the world where the player currently isn't. So a 'jump cut' from one location to another isn't going to work anyway.
You set out on a task which will take a long time &mdash; such as a journey, but also such as any routine task. You're shown either a 'fast forward' of your character carrying out this task, or a series of cinematic 'shots along the way'. This depends, of course, on there being continuous renderable landscape between your departure and your destination, but there will be. This fast-forward proceeds at a substantially higher time gearing than normal game time &mdash; ten times as fast perhaps; we need it to, because as well as doing backgound scenery loading to move from one location to another, we're also simulating lots of non-player agents' actions in parts of the world where the player currently isn't. So a 'jump cut' from one location to another isn't going to work anyway.
The player can interrupt 'fast forward' at any time. But also, the game itself may bring you out of fast forward when it anticipates that there may be action which requires decision - for example, when there are outlaws in the vicinity. And it will do this **before** the player's party is under immediate attack - the player will have time to take stock of the situation and prepare appropriately. Finally, this will take place in the full open world; the player will have the option to choose *not* to enter the narrow defile, for example, to ask local people (if there are any) for any news of outlaw activity, or, if they are available, to send forward scouts.
The player can interrupt 'fast forward' at any time. But also, the game itself may bring you out of fast forward when it anticipates that there may be action which requires decision &mdash; for example, when there are outlaws in the vicinity. And it will do this **before** the player's party is under immediate attack &mdash; the player will have time to take stock of the situation and prepare appropriately. Finally, this will take place in the full open world; the player will have the option to choose *not* to enter the narrow defile, for example, to ask local people (if there are any) for any news of outlaw activity, or, if they are available, to send forward scouts.

View file

@ -0,0 +1,70 @@
# Selecting the Player Character
## Background
Many computer role playing games, particularly older ones such as Neverwinter Nights, allow you to 'design' your player character from a fairly broad canvas. Race, class, attributes, gender and appearance are all selectable.
Choice has eroded over time. For example the Dragon Age series, where you can chose between three races, two genders, and a small number of classes. In the Mass Effect trilogy, you play as Shepard, who is human and essentially a Fighter, but can be either male or female and whose appearance you can customise. You can play as either lawful good or chaotic neutral. In Cyberpunk 2077, you play as V, who is human, either male or female, essentially a Fighter, and chaotic neutral.
In more recent games, there has been a trend towards more limited choice. In the games of The Witcher series, you get no choice at all, but play as Geralt of Rivia, who in the categorisation of Dungeons and Dragons, is a Fighter/Ranger, male, human, and somewhere between chaotic good and chaotic neutral depending on how you play him. In the Horizon series, you play as Aloy, again a Fighter/Ranger, female, human, and essentially chaotic good.
As I've argued elsewhere, part of the reason for limiting choice is voice acting.
Limiting choice of player character, especially in games with increasingly highly scripted stories, limits replayability; after two or three playthroughs, there are very few interesting surprises left.
## The Self-voiced Player
If we have voice interaction sufficiently sophisticated that we can allow the player character to say more or less whatever they want to say &mdash; [and my argument here is that we can do this](Gossip_scripted_plot_and_Johnny_Silverhand.md) &mdash; then we don't need voice acting for the player character, and that gives us a lot of freedom. There's then really no reason why the player can't inhabit any character in the game world and play as that character.
## Tinder as a Character Selector
Tinder is a dating app. It shows you pictures (with brief profiles) of potential partners, and you choose from them by swiping left to reject them, or right to express interest in them. That's a kernel of an idea for how to select from among a large selection of people.
So how about:
1. The game developer selects a large subset of characters in the game as potentially playable. This might be as large as all characters who are not plot characters, as small as only soldiers, or most plausibly, any adult who is not yet in a long term romantic relationship. This forms the candidate set.
2. In the character selector, the game shows a character chosen at random from the set, and, each time the player rejects the character shown, shows another until the player accepts a character.
That works, but we can do better.
## Refining the Selection
Suppose, below the image of the character on the selection screen, we have a short text caption with name, age, home, occupation, gender, and below that, we have a row of icons showing attributes, with some representation of the character's relative measurement of that attribute. Clicking one of these attribute icons would be interpreted as meaning 'show me a character quite like the current character, but having a higher score on this particular attribute'.
### Refinable Attributes
In lots of games which present the player with dialogue options, there are some options which can't be selected unless the player character passes a 'skill check'. Very often, for example, a player won't be able to issue a particular threat unless they have a specific value of strength, or to say something flirtatious unless they have a specific value of charm.
It makes no sense in a game in which the player gets to freely choose what to say for an attribute like 'charm' to be a refinable attribute. Instead, responding to 'charming' or flirtatious or threatening or funny or sexually suggestive speech is a matter for the programming of a particular non-player character (although the interpretation of the speech and the tagging of it as charming or flirtatious or threatening or funny or suggestive would be a function of the top level speech input processor).
So, sensibly refinable attributes might include things like
1. Strength;
2. Agility;
3. Dexterity;
4. Endurance.
I did think that 'intelligence' or 'learning' might be on that list but the more I think of it, the harder I find it to understand how low intelligence might be represented in a game in which the player speaks freely.
There's another attribute icon with slightly different semantics which might sensibly be added, and that's gender. Selecting this icon would be interpreted as meaning 'show me a character quite like the current character, but having a different gender'.
### Summary design
So the character selecter now looks like
1. A main area in which a rendering of the proposed character is shown; this rendering can be zoomed and rotated, so that the player can look at the face and body from different angles;
2. A description panel, normally hidden but when displayed replacing the character rendering in the main area, giving fuller biographical information about the character;
3. Below the main area, a caption, giving name, age, gender, occupation, home;
4. To the right hand side, a vertical column of attribute icons.
To interact with the screen, the player can
1. Zoom in and out on the rendered image, for example with a mouse scroll wheel or the left and right trigger buttons of a game controller;
2. Rotate the rendered image, for example by dragging with the right mouse button held down or with the right joystick of a game controller;
3. Toggle between the character render and the description panel;
4. When the description panel is displayed, scroll it;
5. Select any attribute icon to refine the choice of character;
6. 'Swipe left' (or other action) to reject the current choice of character and choose another, without refining in any specific way;
7. 'Swipe right' to select the current character and procede into the game.

View file

@ -2,7 +2,7 @@
#### Wednesday, 30 December 2009
*This essay is part of a series with '[Worlds and Flats](Worlds-and-flats.html)' and '[The spread of knowledge in a large game world](The-spread-of-knowledge-in-a-large-game-world.html)'; if you haven't read those you may want to read them before reading this. This essay describes how a large world can come into being and can evolve. I've written again on this subject since - see '[Populating a game world](Populating-a-game-world.html)')*
*This essay is part of a series with '[Worlds and Flats](https://www.journeyman.cc/blog/posts-output/2008-04-04-worlds-and-flats/)' and '[The spread of knowledge in a large game world](The-spread-of-knowledge-in-a-large-game-world.html)'; if you haven't read those you may want to read them before reading this. This essay describes how a large world can come into being and can evolve. I've written again on this subject since - see '[Populating a game world](Populating-a-game-world.html)')*
### Microworld
@ -34,7 +34,7 @@
### Microworld Two
The objective of this essay is to outline an angorithm for creating inhabited landscapes in which games can be set, which are satisfyingly believable when rendered in three dimensions. The objective of creating landscapes 'procedurally' that is, with algorithms is that they can be very much larger than designed landscapes for the same richness of local detail. This does not mean that every aspect of the final landscape must be 'procedural'. It would be possible to use the techniques outlined here to create landscapes which were different every time the game was played, but it would be equally possible to create a landscape which was frozen at a particular point and then hand edited to add features useful to the game's plot. And while I'm principally thinking in this about role playing games, this sort of landscape would be applicable to many other sorts of games strategy games, god games, first person shooters...
The objective of this essay is to outline an algorithm for creating inhabited landscapes in which games can be set, which are satisfyingly believable when rendered in three dimensions. The objective of creating landscapes 'procedurally' that is, with algorithms is that they can be very much larger than designed landscapes for the same richness of local detail. This does not mean that every aspect of the final landscape must be 'procedural'. It would be possible to use the techniques outlined here to create landscapes which were different every time the game was played, but it would be equally possible to create a landscape which was frozen at a particular point and then hand edited to add features useful to the game's plot. And while I'm principally thinking in this about role playing games, this sort of landscape would be applicable to many other sorts of games strategy games, god games, first person shooters...
### The physical geography

View file

@ -8,7 +8,7 @@ OK? Let's start.
When a man and a woman have sex, there's a non-zero chance that the woman will get pregnant. There's a zero chance that the male will get pregnant.
A woman can typically give birth to of the order of twelve children in the course of her life, and each childbirth involves a non-zero risk of death. If modelling the sort of bronze-age-to-late-medieval cultures I'm generally considering, there are no available reliable methods of contraception, although their may be, for example, known spermicidal or abortifacient spells or potions. If it's abortifacient, that's pretty unpleasant for the woman, too.
A woman can typically give birth to of the order of twelve children in the course of her life, and each childbirth involves a non-zero risk of death. If modelling the sort of bronze-age-to-late-medieval cultures I'm generally considering, there are no available reliable methods of contraception, although there may be, for example, known spermicidal or abortifacient spells or potions. If it's abortifacient, that's pretty unpleasant for the woman, too.
Children, especially when young, are very vulnerable and need protection. Children with good protection are much more likely to survive to adulthood. Raising children involves a fair amount of work.
@ -26,7 +26,7 @@ Another significant point is that women's ability to bear children ceases at a m
## Why have sex at all?
If a character has 'having children' - the [**Ancestor**](intro.html#aspirations-and-goals) aspiration, in my typology - as their key aim, then they will want to have sex. But to have children in this sense is to have acknowledged children, so while a male character may be motivated to have multiple female partners, he will never the less have some degree of long term committment to them, and will want both to feel confident that the children are his and to be recognised by their father.
If a character has 'having children' &mdash; the [**Ancestor**](intro.html#aspirations-and-goals) aspiration, in my typology &mdash; as their key aim, then they will want to have sex. But to have children in this sense is to have acknowledged children, so while a male character may be motivated to have multiple female partners, he will never the less have some degree of long term committment to them, and will want both to feel confident that the children are his and to be recognised by their father.
From the point of view of seeking to become an Ancestor, there is little benefit to the woman in having multiple partners, except in very harsh environments. It will be easier to give one partner confidence that all your children are his, and while a man can increase his number of potential progeny by having multiple wives, mistresses or other classes of long-term female sexual partners, a woman cannot.
@ -42,4 +42,13 @@ Sex, done right, is an extremely pleasant pastime. Sex can also be used to creat
For women, sex with other women carries with it no risk of pregnancy, so can be enjoyed or used for any of these purposes in very much the same way as it can by men; in other words, particularly for women, homosexual sex can be more lighthearted and carefree than heterosexual sex. To what extend our notions of homosexuality and heterosexuality are cultural I simply don't know. But because no children will result, a woman can afford to be more promiscuous with other women than she can with men.
##
## Women and warrior/adventurer lifestyles
Generally speaking, people do not want to take their children onto a battlefield. If you're going to have a game world in which women significantly take on warrior or adventurer roles, then you must either have
* A culture which expects female warriors to be celibate; or
* A culture with access to and acceptance of safe and reliable contraception or abortion; or
* An acceptance of leaving infant children with grandparents, other relatives or foster carers for long periods;
* A system of long term creches;
* Any combination of the above.

View file

@ -14,7 +14,7 @@ This is mainly a land game. Broadly, caravans take the place of ships in Elite o
## A political simulation
Broadly, aristons claim territories in an essentiallu feudal arrangement, drive out outlaws, and levy taxes.
Broadly, aristons claim territories in an essentially feudal arrangement, drive out outlaws, and levy taxes.
An ariston will be popular if their regime is stable, if taxes are low, justice is considered fair, oppression is low and depredations by outlaws are minimal. The more unpopular an ariston is, the more resistant the populace will be to paying their taxes, meaning the more military force needs to be diverted to tax collection and the greater the oppression. Taxes are required to pay soldiers and to maintain high roads, bridges, markets and other infrastructure. Merchants will prefer to travel routes which are better policed and maintained, which means more merchants trading in your markets, which means more tax.

View file

@ -2,18 +2,17 @@
#### Saturday, 26 April 2008
![part of the role of Dandelion, in The Witcher games, is to provide the player with news](https://4.bp.blogspot.com/-F2gxx0dRM8o/UlfSsRe8ybI/AAAAAAAAYIA/I1I9D5Yk7to/s1600/Tw2_full_Dandelion.png)
### Note
_This version of this essay has been adapted to use the code in `the-great-game.gossip.news-items`, [q.v.](the-great-game.gossip.news-items.html). The original version of the essay is [still available on my blog](https://blog.journeyman.cc/2008/04/the-spread-of-knowledge-in-large-game.html)._
*This version of this essay has been adapted to use the code in `the-great-game.gossip.news-items`, [q.v.](the-great-game.gossip.news-items.html). The original version of the essay is [still available on my blog](https://www.journeyman.cc/blog/posts-output/2008-04-26-the-spread-of-knowledge-in-a-large-game-world/).*
-----
These days we have television, and news. But in a late bronze age world there are no broadcast media. News spreads by word of mouth. If non-player characters are to respond effectively to events in the world, knowledge has to spread.
How to model this?
Some non-player characters - doesn't need to be many - are news-spreaders. News-spreaders need to travel. They have to travel even when there are no player characters in the vicinity. But, they don't have to travel very often - once or twice every game day. When a news-spreader is in the immediate vicinity of another character, the pair may (with some degree of randomness) exchange news. There needs to be a hierarchy in the exchange of news, so that 'I-saw' events need to be more likely to be passed on than 'I-heard' events; there needs to be a counter which counts the number of times a knowledge item has been passed on, and also an age counter so that knowledge items are less likely to be passed on as they get older.
Some non-player characters &mdash; doesn't need to be many &mdash; are news-spreaders. News-spreaders need to travel. They have to travel even when there are no player characters in the vicinity. But, they don't have to travel very often &mdash; once or twice every game day. When a news-spreader is in the immediate vicinity of another character, the pair may (with some degree of randomness) exchange news. There needs to be a hierarchy in the exchange of news, so that 'I-saw' events need to be more likely to be passed on than 'I-heard' events; there needs to be a counter which counts the number of times a knowledge item has been passed on, and also an age counter so that knowledge items are less likely to be passed on as they get older.
One obvious class of news-spreader is a merchant. Merchant agents can either shuttle mechanically between a fixed group of markets or else possibly respond intelligently to supply and demand. Provided that there is a mesh of merchant routes covering the markets of the game world, and that a useful subset of non-merchant characters are required to visit a market every few game days, this should give a reasonably realistic framework for news spreading.
@ -65,11 +64,11 @@ But also, the added knowledge is *degraded*. If the recipient isn't from Hans'hu
:nth-hand 4,
:time-stamp 17946463}
The timestamp could also be degraded, or lost altother - although how exactly this is represnted I'm not certain. Someone interested in the incident may remember 'it was exactly 17 days ago', whereas someone else may remember that it was 'this month, I think'.
The timestamp could also be degraded, or lost altother &mdash; although how exactly this is represnted I'm not certain. Someone interested in the incident may remember 'it was exactly 17 days ago', whereas someone else may remember that it was 'this month, I think'.
Obviously the rate of decay, and the degree of randomness, of the news-passing algorithm would need to be tuned, but this schema seems to me to describe a system with the following features:
* Non-player characters can respond to questions about significant things which happen in the world - without it all having to be scripted
* Non-player characters can respond to questions about significant things which happen in the world &mdash; without it all having to be scripted
* If you travel fast enough, you can keep ahead of your notoriety
* Characters on major trade routes will know more about what is happening in the world than characters in backwaters
@ -79,8 +78,8 @@ The timestamp could also be degraded, or lost altother - although how exactly th
Let's work around the idea that a 'game day' equates to about two hours of wall clock time. Let's work around the idea that there are of the order of fifty markets in the game world, and that for each market there are two or three merchants whose 'home base' it is.
Obviously non-player characters who are within the vicinity of a player character have to be 'awake', in order that the player can see them interacting with their world and can interact with them. Those characters have to be in working memory and have to be in the action polling loop in any case. So there's no extra cost to their gossiping away between each other - around the player there's a moving bubble of gossip, allowing each character the player interacts with to have a high probability of having some recent news.
Obviously non-player characters who are within the vicinity of a player character have to be 'awake', in order that the player can see them interacting with their world and can interact with them. Those characters have to be in working memory and have to be in the action polling loop in any case. So there's no extra cost to their gossiping away between each other &mdash; around the player there's a moving bubble of gossip, allowing each character the player interacts with to have a high probability of having some recent news.
But the merchants who aren't in the vicinity of a player don't have to be in working memory all the time. Each merchant simply requires to be 'woken up' - loaded into memory - once per game day, move a day's journey in one hop, and then, if arriving at an inn or at a market, wake and exchange news with one resident character - an innkeeper or a gossip. So the cost of this algorithm in a fifty-market game is at worst the cost of loading and unloading two non-player characters from memory every minute, and copying two or three statements from the knowledge set of one to the knowledge set of the other. If you're dynamically modifying significance scores, of course, you'd need to also load the characters about whom news was being passed on; but this still doesn't seem unduly onerous.
But the merchants who aren't in the vicinity of a player don't have to be in working memory all the time. Each merchant simply requires to be 'woken up' &mdash; loaded into memory &mdash; once per game day, move a day's journey in one hop, and then, if arriving at an inn or at a market, wake and exchange news with one resident character &mdash; an innkeeper or a gossip. So the cost of this algorithm in a fifty-market game is at worst the cost of loading and unloading two non-player characters from memory every minute, and copying two or three statements from the knowledge set of one to the knowledge set of the other. If you're dynamically modifying significance scores, of course, you'd need to also load the characters about whom news was being passed on; but this still doesn't seem unduly onerous.
Obviously, if memory is not too constrained it may be possible to maintain all the merchants, all the innkeepers and all the characters currently being talked about in memory all the time, further reducing the cost.

View file

@ -0,0 +1,56 @@
# Things Voice Interaction Enables
## Organic quest routing
In a world in which you can talk to non-player characters, and in which non-player characters know the directions to things which are local to their homes (and some, travellers, will be able to give you routes to things further away), when you need to get to your next waypoint you can just ask for directions. That much is easy.
But something much richer occurred to me.
Suppose you're entering a village, and you meet a random character. That character knows any local quest giver, and what it is that quest giver needs and, indeed, they know this whether the quest is scripted or organic.
So the random character could say
> Hello, I'm Tobias, and that my mill over there. Who might you be, stranger?
At which point you can either tell him, or not. Suppose you tell him, he could say
> Oh! I've heard of you. It's said you're very handy with a sword.
And you can reply however you like, acknowledging, or being modest, or perhaps even denying (although from this line of dialogue if you deny he'll think you're being modest, for reasons see later). He can then say, taking our example from the 'abducted child' quest in [the Introduction](intro.html#dynamic-quests),
> Thing is, old granny Grizzel's granddaughter Esmerelda has been abducted by bandits, and we've done a whip-around for a reward for someone who can rescue the girl.
At which point you may reply that you'll do it, or be non-committal, or say you won't. If you say you will, he can say,
> Well, you should talk to granny Grizzel, she lives in the white house by the crossroads, half a mile that-a-way (pointing).
If you say you won't, he can say,
> It would be a virtuous act, the old lady is fair desperate. If you should change your mind, you should talk to her; she lives in the white house by the crossroads, half a mile that-a-way (pointing).
OK, but what if, in the game world, the player character is not good with a sword? Well, the 'abducted child' quest can be resolved by violence; but it can also be resolved by persuasion, or by sneakiness, or by bribery. So suppose the player isn't (in the game) good with a sword, but is good at negotiation. Then in the initial approach, Tobias could say
> Oh! I've heard of you. It's said you're very handy at persuasion... Thing is, old granny Grizzel's granddaughter Esmerelda has been abducted by bandits, and we've done a whip-around for a ransom, but she's lacking someone who can negotiate for her.
It's the same quest, and, whatever Tobias has said, the player can still use either violence or persuasion or trickery to complete the quest (and gain appropriate reputation thereby), but it's flexible enough to adapt to the player's in-game persona, and it means we can direct the player to quest-givers without having to stick a bloody great icon on the quest giver's head.
So, to repeat for clarity: the idea is, if there is a quest in the vicinity, whether organic or scripted, many of the quest giver's neighbours may know about it, and will bring it up in conversation, introducing it and directing the player to the quest giver. And I believe that this can be done reasonably naturally.
Obviously there are some sorts of quests where for narrative reasons he quest giver will **not** want their neighbours to know of it, and those quests need to be signposted differently; but I think that effective ways need to be found of signposting those quests to the player without resorting to noticeboards or quest icons.
## Command in Battles
Player characters in role playing games are often narratively great heroic leaders &mdash; see any of the Dragon Age games but particularly Inquisition for examples of this &mdash; but when it comes to a pitched battle all they can do is follow a scripted battle plan and fight individual actions, because in current generation role-playing games there is no effective user interface to allow strategic and tactical control of a battle.
So how would a real-world, before modern communications technology, war leader command a battle? Why, by observing the battle and talking to people, and those are both things that in our game the player can do.
So, there are two stages to battle communication: the first is the council of war, before the battle, in which the battle plan is agreed. For the non-player characters to have any significant input into this, we'd need a really good knowledge base of appropriate battle strategies with heuristics for which plan fits which sort of geography and which sort of enemy, but that could be quite fun to develop; but in principle it's sufficient for the player character to be able to say to each of the divisional captains "I want you to do this," and for each captain to say first "yes, I understand" (or "please clarify"), and then "yes, I will do it" (or "yes, I will try").
No battle plan, of course, survives first contact with the enemy. It must be possible to update the plan during the battle, and messengers were used to carry new orders from the commander to subordinates. That, of course, we can also do.
So, ideally (and in describing this I'll try to give 'less than ideal' alternatives where I see them), you can gather your captains to a council of war, either by speaking to them directly or by sending messengers round. At the council of war, non-player-character captains can suggest possible battle plans drawn from a common knowledge base, but can have individual levels of boldness or caution. However, if you've been appointed battle leader, then provided they're individually still loyal to you then they will ultimately agree to what you order.
When battle is joined you can either join in the fighting in the front line in which case your strategic overview is going to be very limited and you'll just have to hope your initial plan was good enough; or else you can sit on a hilltop overlooking the battlefield with your trumpeter and your messengers, and send messages to control the fight, but not actually take part much yourself (unless everything really goes to shit and your position is overrun).
In real world battles orders were often misunderstood; I don't think I should do anything special to model that. But orders (other than trumpet calls) will necessarily take finite time, and if the battlefront is really messed up messengers may fail to get through.

View file

@ -5,9 +5,18 @@
![The Witcher: Conversation with Kalkstein](https://3.bp.blogspot.com/-ZI90HLjEcuo/VO4f-yXP3sI/AAAAAAAAZt4/C0hQ7hScWyM/s1600/witcher_conversation.jpg)
Long, long, time ago, I can still remember when... we played (and wrote) adventure games where the user typed at a command line, and the system printed back at them. A Read-Eval-Print loop in the classic Lisp sense, and I wrote my adventure games in Lisp. I used the same opportunistic parser whether the developer was building the game
Create a new room north of here called dungeon-3 the player was playing the game
Pick up the rusty sword and go north or the player was talking to a non-player character
Say to the wizard 'can you tell me the way to the castle' Of course, the parser didn't 'understand' English. It worked on trees of words, in which terminal nodes were actions and branching nodes were key words, and it had the property that any word it didn't recognise at that point in sentence was a noise word and could be ignored. A few special hacks (such as 'the', 'a', or 'an' was an indicator that what came next was probably a noun phrase, and thus that if there was more than one sword in the player's immediate environment the one that was wanted was the one tagged with the adjective 'rusty'), and you ended up with a parser that most of the time convincingly interpreted most of what the player threw at it.
> Create a new room north of here called dungeon-3
the player was playing the game
> Pick up the rusty sword and go north
or the player was talking to a non-player character
> Say to the wizard 'can you tell me the way to the castle'
Of course, the parser didn't 'understand' English. It worked on trees of words, in which terminal nodes were actions and branching nodes were key words, and it had the property that any word it didn't recognise at that point in sentence was a noise word and could be ignored. A few special hacks (such as 'the', 'a', or 'an' was an indicator that what came next was probably a noun phrase, and thus that if there was more than one sword in the player's immediate environment the one that was wanted was the one tagged with the adjective 'rusty'), and you ended up with a parser that most of the time convincingly interpreted most of what the player threw at it.
Text adventures fell into desuetude partly because they weren't graphic, but mainly because people didn't find typing natural, or became dissatisfied with the repertoire of their parsers. Trying to find exactly the right combination tokens to persuade the game to carry out some simple action is not 'fun', it's just frustrating, and it turned people off. Which is a shame because just at the time when people were abandoning text adventures we were beginning to have command parsers which were actually pretty good. Mine, I think, were good - you could have a pretty natural conversation with them, and in 'building' mode, when it hit a 'sorry I don't understand' point, it allowed you to input a path of keywords and a Lisp function so that in future it would understand.

View file

@ -33,21 +33,21 @@ repertoire of speech.
## Previous essays that are relevant
* [The spread of knowledge in a large game world](The-spread-of-knowledge-in-a-large-game-world.html) (2008) discusses what individual non-player characters know, and how to model dynamic updates to their knowledge;
* [Settling a game world](https://blog.journeyman.cc/2009/12/settling-game-world.html) (2009) gives rough outline of ideas about creating the environment, including modelling things like soil fertility, local building materials, and consequently local architecture;
* [Tessellated multi-layer height map](https://blog.journeyman.cc/2013/07/tessellated-multi-layer-height-map.html) (2013) gives ideas for how a designed geography for a very large world could be stored relatively economically;
* [Genetic Buildings](https://blog.journeyman.cc/2013/07/genetic-buildings.html) (2013) sketches algorithms which would allow procedurally-generated buildings to be site-appropriate, broadly variable and reproducable;
* [Settling a game world](Settling-a-game-world.html) (2009) gives rough outline of ideas about creating the environment, including modelling things like soil fertility, local building materials, and consequently local architecture;
* [Tessellated multi-layer height map](https://www.journeyman.cc/blog/posts-output/2013-07-04-tessellated-multilayer-height-map/) (2013) gives ideas for how a designed geography for a very large world could be stored relatively economically;
* [Genetic Buildings](Genetic-buildings.html) (2013) sketches algorithms which would allow procedurally-generated buildings to be site-appropriate, broadly variable and reproducable;
* [Populating a game world](Populating-a-game-world.html) (2013) provides outline algorithms for how a world can be populated, and how organic mixes of trades and crafts can be modelled;
* [Modelling the change from rural to urban](https://blog.journeyman.cc/2013/07/modelling-change-from-rural-to-urban.html) (2013) describes the idea of procedurally modelling settlements, but it is grid-based and not particularly satisfactory and has largely been superceded in my thinking;
* [Of pigeons, and long distance messaging in a game world](https://blog.journeyman.cc/2013/10/of-pigeons-and-long-distance-messaging.html) (2013) builds on ideas about flows of information;
* [Modelling rural to urban, take two](https://blog.journeyman.cc/2013/10/modelling-rural-to-urban-take-two.html) (2013) revisited the idea of modelling organic settlement structures, trying to find algorithms which would naturally produce more persuasive settlement models, including further ideas on the procedural generation of buildings;
* [More on modelling rivers](https://blog.journeyman.cc/2014/09/more-on-modelling-rivers.html) (2014) talks about modelling hydrology, with implications for soil fertility;
* [Modelling settlement with cellular automata](https://blog.journeyman.cc/2014/08/modelling-settlement-with-cellular.html) (2014) talks about successful implementation of algorithms to model vegetative environment, human settlement and the impact of human settlement on the environment;
* [Voice acting considered harmful](https://blog.journeyman.cc/2015/02/voice-acting-considered-harmful.html) (2015) outlines the ideas behind full speech interaction with non-player characters, and modelling what those non-player characters should be able to speak about;
* [Modelling the change from rural to urban](https://www.journeyman.cc/blog/posts-output/2013-07-17-modelling-the-change-from-rural-to-urban/) (2013) describes the idea of procedurally modelling settlements, but it is grid-based and not particularly satisfactory and has largely been superceded in my thinking;
* [Of pigeons, and long distance messaging in a game world](https://www.journeyman.cc/blog/posts-output/2013-10-01-of-pigeons-and-long-distance-messaging-in-a-game-world/) (2013) builds on ideas about flows of information;
* [Modelling rural to urban, take two](https://www.journeyman.cc/blog/posts-output/2013-10-14-modelling-rural-to-urban-take-two/) (2013) revisited the idea of modelling organic settlement structures, trying to find algorithms which would naturally produce more persuasive settlement models, including further ideas on the procedural generation of buildings;
* [More on modelling rivers](https://www.journeyman.cc/blog/posts-output/2014-09-28-more-on-modelling-rivers/) (2014) talks about modelling hydrology, with implications for soil fertility;
* [Modelling settlement with cellular automata](https://www.journeyman.cc/blog/posts-output/2014-08-26-modelling-settlement-with-a-cellular-automaton/) (2014) talks about successful implementation of algorithms to model vegetative environment, human settlement and the impact of human settlement on the environment;
* [Voice acting considered harmful](Voice-acting-considered-harmful.html) (2015) outlines the ideas behind full speech interaction with non-player characters, and modelling what those non-player characters should be able to speak about;
* [Baking the world](Baking-the-world.html) (2019) an outline of the overall process of creating a world.
## Organic and emergent game-play
If a world is [dynamically populated](https://blog.journeyman.cc/2014/08/modelling-settlement-with-cellular.html), with [dynamic allocation of livelihoods](https://blog.journeyman.cc/2013/07/populating-game-world.html) then several
If a world is [dynamically populated](https://www.journeyman.cc/blog/posts-output/2014-08-26-modelling-settlement-with-a-cellular-automaton/), with [dynamic allocation of livelihoods](Populating-a-game-world.html) then several
aspects of gameplay will emerge organically. First, of course, is just
exploring; in a dynamically changing world there will always be more to
explore, and it will be different in each restart of the game.
@ -119,7 +119,7 @@ To make dynamic quests work, of course, you need a dynamic world; a world in
which conflicts can arise. A world in which traders trade, robbers rob, lovers
love, haters hate, scandal-mongers make scandal, organically and dynamically
whether the player is there or not, and where news of these events will filter
through to the player through the [gossip network](https://blog.journeyman.cc/2008/04/the-spread-of-knowledge-in-large-game.html) also organically and dynamically.
through to the player through the [gossip network](The-spread-of-knowledge-in-a-large-game-world.html) also organically and dynamically.
## Extending the story
@ -177,7 +177,7 @@ easy:
2. **Master**: what is the sum of (or average of) the esteem held for this agent by other agents of the same craft?
3. **Explorer**: (e.g.) what is the sum of the distance between the most northerly and most southerly, and the most easterly and most westerly, locations this agent has visited?
4. **Climber**: how many 'promotions' has this agent had in the game?
6. **Conqueror**: how many total vassales, recursively, has this agent?
5. **Conqueror**: how many total vassals, recursively, has this agent?
6. **Citizen**: really, really tricky. Probably what is the average esteem for this agent among all agents within a specified radius? - although this will score more highly for agents who have taken part in notable events, and what I'm really thinking of for my ideal 'good citizen' is someone who really hasn't.
So each agent is assigned - by the dreaded random number generator - one top
@ -323,13 +323,16 @@ A caravan or ship costs so much per day to run, irrespective of whether full
or empty. So the base cost of a journey is a function of the time taken, which
is essentially a function of the distance.
Obviously, on top of the base cost of movement there are tolls, which are imposed
by the aristons through whose territory the journey passes (and therefore predictable, and can be used in route planning), and also the risk of having to bribe or fight outlaws, and the possible need to hire mercenaries to defend against outlaws, which is not predictable but can be estimated and thus also used in route planning.
### Outlawry and merchants
Outside the domains of aristons, outlaws may intercept caravans; when this
happens the following outcomes are possible:
1. The merchant (together with any mercenaries the merchant has hired to protect the caravan) successfully fights off the outlaws;
2. The outlaws steal the entire cargo (and may kill the merchant);
2. The outlaws steal the entire cargo (and may kill the merchant and others);
3. The merchant pays protection money to the outlaws, typically around 5%-10% of the value of cargo carried;
4. The merchant employs the outlaws as caravan guards (see below);
5. The outlaws allow the caravan to pass unmolested;
@ -362,7 +365,7 @@ Generally, if a merchant buys goods in an ariston's market, or sells goods
in the ariston's market, then the economy benefits and the ariston benefits
from that; so the 'tax' element is part of the market markup. But if a
caravan passes through an ariston's territory without stopping at a market,
there's probably a tax of about 5% of value.
there's probably a toll of about 5% of value.
Generally, an ariston's army will control outlawry within the ariston's
domain, so outlaw encounters within a domain are unlikely. Soldiers could

View file

@ -0,0 +1,143 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/agent/agent.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.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;&nbsp;primarily&nbsp;but&nbsp;not&nbsp;exclusively
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;characters.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.objects.game-object&nbsp;:refer&nbsp;[ProtoObject]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.objects.container&nbsp;:refer&nbsp;[ProtoContainer]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
006&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&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">
008&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">
009&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">
010&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
011&nbsp;&nbsp;(defprotocol&nbsp;ProtoAgent
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&quot;An&nbsp;object&nbsp;which&nbsp;can&nbsp;act&nbsp;in&nbsp;the&nbsp;world&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;(act
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[actor&nbsp;world&nbsp;circle]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Allow&nbsp;`actor`&nbsp;to&nbsp;do&nbsp;something&nbsp;in&nbsp;this&nbsp;`world`,&nbsp;in&nbsp;the&nbsp;context&nbsp;of&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`circle`;&nbsp;return&nbsp;the&nbsp;new&nbsp;state&nbsp;of&nbsp;the&nbsp;actor&nbsp;if&nbsp;something&nbsp;was&nbsp;done,&nbsp;`nil`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;nothing&nbsp;was&nbsp;done.&nbsp;Circle&nbsp;is&nbsp;expected&nbsp;to&nbsp;be&nbsp;one&nbsp;of
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
018&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`:active`&nbsp;-&nbsp;actors&nbsp;within&nbsp;visual&#x2F;audible&nbsp;range&nbsp;of&nbsp;the&nbsp;player
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;character;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`:pending`&nbsp;-&nbsp;actors&nbsp;not&nbsp;in&nbsp;the&nbsp;active&nbsp;circle,&nbsp;but&nbsp;sufficiently&nbsp;close
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;it&nbsp;that&nbsp;they&nbsp;may&nbsp;enter&nbsp;the&nbsp;active&nbsp;circle&nbsp;within&nbsp;a&nbsp;short&nbsp;period;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`:background`&nbsp;-&nbsp;actors&nbsp;who&nbsp;are&nbsp;active&nbsp;in&nbsp;the&nbsp;background&nbsp;in&nbsp;order&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handle&nbsp;trade,&nbsp;news,&nbsp;et&nbsp;cetera;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`other`&nbsp;-&nbsp;actors&nbsp;who&nbsp;are&nbsp;not&nbsp;members&nbsp;of&nbsp;any&nbsp;other&nbsp;circle,&nbsp;although
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I&#x27;m&nbsp;not&nbsp;clear&nbsp;whether&nbsp;it&nbsp;would&nbsp;ever&nbsp;be&nbsp;appropriate&nbsp;to&nbsp;invoke&nbsp;an
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`act`&nbsp;method&nbsp;on&nbsp;them.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
028&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;`act`&nbsp;method&nbsp;*must&nbsp;not*&nbsp;have&nbsp;side&nbsp;effects;&nbsp;it&nbsp;must&nbsp;*only*&nbsp;return&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;state.&nbsp;If&nbsp;the&nbsp;actor&#x27;s&nbsp;intention&nbsp;is&nbsp;to&nbsp;seek&nbsp;to&nbsp;change&nbsp;the&nbsp;state&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;something&nbsp;else&nbsp;in&nbsp;the&nbsp;game&nbsp;world,&nbsp;it&nbsp;must&nbsp;add&nbsp;a&nbsp;representation&nbsp;of&nbsp;that
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intention&nbsp;to&nbsp;the&nbsp;sequence&nbsp;which&nbsp;will&nbsp;be&nbsp;returned&nbsp;by&nbsp;its
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`pending-intentions`&nbsp;method.&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;(pending-intentions
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[actor]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Returns&nbsp;a&nbsp;sequence&nbsp;of&nbsp;effects&nbsp;an&nbsp;actor&nbsp;intends,&nbsp;as&nbsp;a&nbsp;consequence&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acting.&nbsp;The&nbsp;encoding&nbsp;of&nbsp;these&nbsp;is&nbsp;not&nbsp;yet&nbsp;defined.&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
038&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
039&nbsp;&nbsp;(defrecord&nbsp;Agent
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&quot;A&nbsp;default&nbsp;agent.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;[name&nbsp;craft&nbsp;home&nbsp;culture]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;ProtoObject
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;ProtoContainer
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;ProtoAgent
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;)
</span><br/>
</body>
</html>

View file

@ -0,0 +1,251 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/buildings/module.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.buildings.module
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
002&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&quot;A&nbsp;module&nbsp;of&nbsp;a&nbsp;building;&nbsp;essentially&nbsp;something&nbsp;like&nbsp;a&nbsp;portacabin,&nbsp;which&nbsp;can&nbsp;be
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assembled&nbsp;together&nbsp;with&nbsp;other&nbsp;modules&nbsp;to&nbsp;make&nbsp;a&nbsp;complete&nbsp;building.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Modules&nbsp;need&nbsp;to&nbsp;include
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;Ground&nbsp;floor&nbsp;modules,&nbsp;having&nbsp;external&nbsp;doors;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;Craft&nbsp;modules&nbsp;--&nbsp;workshops&nbsp;--&nbsp;which&nbsp;will&nbsp;normally&nbsp;be&nbsp;ground&nbsp;floor&nbsp;(except
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;weavers)&nbsp;and&nbsp;may&nbsp;have&nbsp;the&nbsp;constraint&nbsp;that&nbsp;no&nbsp;upper&nbsp;floor&nbsp;module&nbsp;can&nbsp;cover&nbsp;them;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;Upper&nbsp;floor&nbsp;modules,&nbsp;having&nbsp;NO&nbsp;external&nbsp;doors&nbsp;(but&nbsp;linking&nbsp;internal&nbsp;doors);
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;Roof&nbsp;modules
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Role**&nbsp;must&nbsp;be&nbsp;one&nbsp;of:
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;`:primary`&nbsp;a&nbsp;ground&nbsp;floor&nbsp;main&nbsp;entrance&nbsp;module
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;`:secondary`&nbsp;a&nbsp;module&nbsp;which&nbsp;can&nbsp;be&nbsp;upper&nbsp;or&nbsp;ground&nbsp;floor
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;`:upper`&nbsp;a&nbsp;module&nbsp;which&nbsp;can&nbsp;only&nbsp;be&nbsp;on&nbsp;an&nbsp;upper&nbsp;floor,&nbsp;for&nbsp;example&nbsp;one
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;a&nbsp;projecting&nbsp;gallery,&nbsp;balcony&nbsp;or&nbsp;overhang.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Other&nbsp;values&nbsp;for&nbsp;`role`&nbsp;will&nbsp;emerge.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Exits**&nbsp;must&nbsp;be&nbsp;a&nbsp;sequence&nbsp;of&nbsp;keywords&nbsp;taken&nbsp;from&nbsp;the&nbsp;following&nbsp;list:
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;`:left`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;left&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;`:left-front`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;left&nbsp;half&nbsp;of&nbsp;the&nbsp;front&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;`:front`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;front&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;`:right-front`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;right&nbsp;half&nbsp;of&nbsp;the&nbsp;front&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;`:right`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;right&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;`:right-back`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;right&nbsp;half&nbsp;of&nbsp;the&nbsp;back&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7.&nbsp;`:left-back`&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;the&nbsp;back&nbsp;wall
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;module&nbsp;placed&nbsp;on&nbsp;an&nbsp;upper&nbsp;floor&nbsp;must&nbsp;have&nbsp;no&nbsp;exit&nbsp;which&nbsp;opens&nbsp;beyond&nbsp;the&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;footprint&nbsp;of&nbsp;the&nbsp;floor&nbsp;below&nbsp;-&nbsp;no&nbsp;doors&nbsp;into&nbsp;mid&nbsp;air!&nbsp;However,&nbsp;it&nbsp;is&nbsp;allowable&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;indeed&nbsp;is&nbsp;necessary)&nbsp;to&nbsp;allow&nbsp;doors&nbsp;into&nbsp;roof&nbsp;spaces&nbsp;if&nbsp;the&nbsp;adjacent
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;module&nbsp;on&nbsp;the&nbsp;same&nbsp;floor&nbsp;does&nbsp;not&nbsp;yet&nbsp;exist,&nbsp;since&nbsp;otherwise&nbsp;it&nbsp;would&nbsp;be&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;impossible&nbsp;to&nbsp;access&nbsp;a&nbsp;new&nbsp;room&nbsp;which&nbsp;might&nbsp;later&nbsp;be&nbsp;built&nbsp;there.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Load**&nbsp;must&nbsp;be&nbsp;a&nbsp;small&nbsp;integer&nbsp;indicating&nbsp;both&nbsp;the&nbsp;weight&nbsp;of&nbsp;the&nbsp;module&nbsp;and&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;total&nbsp;amount&nbsp;of&nbsp;weight&nbsp;it&nbsp;can&nbsp;support.&nbsp;So&nbsp;for&nbsp;example&nbsp;a&nbsp;stone-built&nbsp;module
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;might&nbsp;have&nbsp;a&nbsp;`load`&nbsp;value&nbsp;of&nbsp;4,&nbsp;a&nbsp;brick&nbsp;built&nbsp;one&nbsp;of&nbsp;3,&nbsp;and&nbsp;a&nbsp;half-timbered&nbsp;one&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;2,&nbsp;and&nbsp;a&nbsp;tent&nbsp;of&nbsp;0.&nbsp;This&nbsp;means&nbsp;a&nbsp;stone&nbsp;ground&nbsp;floor&nbsp;module&nbsp;could&nbsp;support&nbsp;one&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;further&nbsp;floor&nbsp;of&nbsp;stone&nbsp;or&nbsp;brick,&nbsp;or&nbsp;two&nbsp;further&nbsp;floors&nbsp;of&nbsp;half&nbsp;timbered&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;construction;&nbsp;while&nbsp;a&nbsp;brick&nbsp;built&nbsp;ground&nbsp;floor&nbsp;could&nbsp;support&nbsp;a&nbsp;single&nbsp;brick&nbsp;or&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;half-timbered&nbsp;upper&nbsp;floor&nbsp;but&nbsp;not&nbsp;a&nbsp;stone&nbsp;one,&nbsp;and&nbsp;a&nbsp;half-timbered&nbsp;ground&nbsp;floor
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;could&nbsp;only&nbsp;support&nbsp;a&nbsp;half&nbsp;timbered&nbsp;upper&nbsp;floor.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;There&nbsp;also&nbsp;needs&nbsp;to&nbsp;be&nbsp;an&nbsp;undercroft&nbsp;or&nbsp;platform&nbsp;module,&nbsp;such&nbsp;that&nbsp;the&nbsp;area&nbsp;of&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;top&nbsp;of&nbsp;the&nbsp;platform&nbsp;is&nbsp;identical&nbsp;with&nbsp;the&nbsp;footprint&nbsp;of&nbsp;the&nbsp;building,&nbsp;and&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;altitude&nbsp;of&nbsp;the&nbsp;top&nbsp;of&nbsp;the&nbsp;platform&nbsp;is&nbsp;equal&nbsp;to&nbsp;the&nbsp;altitude&nbsp;of&nbsp;the&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;terrain&nbsp;at&nbsp;the&nbsp;heighest&nbsp;corner&nbsp;of&nbsp;the&nbsp;building;&nbsp;so&nbsp;that&nbsp;the&nbsp;actual&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;building&nbsp;doesn&#x27;t&nbsp;float&nbsp;in&nbsp;the&nbsp;air,&nbsp;and&nbsp;also&nbsp;so&nbsp;that&nbsp;none&nbsp;of&nbsp;the&nbsp;doors&nbsp;or&nbsp;windows
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;partly&nbsp;underground.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
054&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;module&nbsp;needs&nbsp;to&nbsp;wrap&nbsp;an&nbsp;actual&nbsp;3d&nbsp;model&nbsp;created&nbsp;in&nbsp;Blender&nbsp;or&nbsp;whatever,&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;have&nbsp;a&nbsp;list&nbsp;of&nbsp;optional&nbsp;**textures**&nbsp;with&nbsp;which&nbsp;that&nbsp;model&nbsp;can&nbsp;be&nbsp;rendered.&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;So&nbsp;an&nbsp;upper&nbsp;floor&nbsp;bedroom&nbsp;module&nbsp;might&nbsp;have&nbsp;the&nbsp;following&nbsp;renders:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
058&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;Bare&nbsp;masonry&nbsp;-&nbsp;constrained&nbsp;to&nbsp;upland&nbsp;or&nbsp;plateau&nbsp;terrain,&nbsp;and&nbsp;to&nbsp;coastal&nbsp;culture
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;Painted&nbsp;masonry&nbsp;-&nbsp;constrained&nbsp;to&nbsp;upland&nbsp;or&nbsp;plateau&nbsp;terrain,&nbsp;and&nbsp;to&nbsp;coastal&nbsp;culture
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;Half-timbered&nbsp;-&nbsp;not&nbsp;available&nbsp;on&nbsp;plateau&nbsp;terrain
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;Weatherboarded&nbsp;-&nbsp;constrained&nbsp;to&nbsp;forest&nbsp;terrain
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;Brick&nbsp;-&nbsp;constrained&nbsp;to&nbsp;arable&nbsp;or&nbsp;arid&nbsp;terrain
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
064&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;course&nbsp;these&nbsp;are&nbsp;only&nbsp;examples,&nbsp;and&nbsp;also,&nbsp;it&#x27;s&nbsp;entirely&nbsp;possible&nbsp;to&nbsp;have
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;example&nbsp;multiple&nbsp;different&nbsp;weatherboard&nbsp;renders&nbsp;for&nbsp;the&nbsp;same&nbsp;module.&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;There&nbsp;needs&nbsp;to&nbsp;be&nbsp;a&nbsp;way&nbsp;of&nbsp;rendering&nbsp;what&nbsp;can&nbsp;be&nbsp;built&nbsp;above&nbsp;what:&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;example,&nbsp;you&nbsp;can&#x27;t&nbsp;have&nbsp;a&nbsp;masonry&nbsp;clad&nbsp;module&nbsp;over&nbsp;a&nbsp;half&nbsp;timbered&nbsp;one,&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;but&nbsp;you&nbsp;can&nbsp;have&nbsp;a&nbsp;half-timbered&nbsp;one&nbsp;over&nbsp;a&nbsp;masonry&nbsp;one.&quot;)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
070&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
071&nbsp;&nbsp;(defrecord&nbsp;BuildingModule
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;[model
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^Double&nbsp;length
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^Double&nbsp;width
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^Double&nbsp;height
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^Integer&nbsp;load&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^clojure.lang.Keyword&nbsp;role
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^clojure.lang.IPersistentCollection&nbsp;textures
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^clojure.lang.IPersistentCollection&nbsp;exits
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;)
</span><br/>
</body>
</html>

View file

@ -0,0 +1,458 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/buildings/rectangular.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.buildings.rectangular
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Build&nbsp;buildings&nbsp;with&nbsp;a&nbsp;generally&nbsp;rectangular&nbsp;floow&nbsp;plan.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;##&nbsp;Motivations
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Right,&nbsp;the&nbsp;idea&nbsp;behind&nbsp;this&nbsp;namespace&nbsp;is&nbsp;many&nbsp;fold.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;To&nbsp;establish&nbsp;the&nbsp;broad&nbsp;principle&nbsp;of&nbsp;genetic&nbsp;buildings,&nbsp;by&nbsp;creating&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;which&nbsp;reproducibly&nbsp;creates&nbsp;reproducible&nbsp;buildings&nbsp;at&nbsp;specified
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;locations,&nbsp;such&nbsp;that&nbsp;different&nbsp;buildings&nbsp;are&nbsp;credibly&nbsp;varied&nbsp;but&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;building&nbsp;at&nbsp;a&nbsp;specified&nbsp;location&nbsp;is&nbsp;always&nbsp;(modulo&nbsp;economic&nbsp;change)&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;Create&nbsp;good&nbsp;rectangular&nbsp;buildings,&nbsp;and&nbsp;investigate&nbsp;whether&nbsp;a&nbsp;single&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;can&nbsp;be&nbsp;used&nbsp;to&nbsp;create&nbsp;buildings&nbsp;of&nbsp;more&nbsp;than&nbsp;one&nbsp;family&nbsp;(e.g.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;it&nbsp;produce&nbsp;flat&nbsp;roofed,&nbsp;north&nbsp;African&nbsp;style,&nbsp;mud&nbsp;brick&nbsp;houses&nbsp;as
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;well&nbsp;as&nbsp;pitch&nbsp;roofed,&nbsp;half&nbsp;timbered&nbsp;northern&nbsp;European&nbsp;houses?)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;Establish&nbsp;whether,&nbsp;in&nbsp;my&nbsp;current&nbsp;state&nbsp;of&nbsp;fairly&nbsp;severe&nbsp;mental&nbsp;illness,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;can&nbsp;actually&nbsp;produce&nbsp;any&nbsp;usable&nbsp;code&nbsp;at&nbsp;all.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
019&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;##&nbsp;Key&nbsp;factors&nbsp;in&nbsp;the&nbsp;creation&nbsp;of&nbsp;a&nbsp;building
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
021&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;###&nbsp;Holding
</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;Every&nbsp;building&nbsp;is&nbsp;on&nbsp;a&nbsp;holding,&nbsp;and,&nbsp;indeed,&nbsp;what&nbsp;I&nbsp;mean&nbsp;by&nbsp;&#x27;building&#x27;&nbsp;here
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;may&nbsp;well&nbsp;turn&nbsp;out&nbsp;to&nbsp;be&nbsp;&#x27;the&nbsp;collection&nbsp;of&nbsp;all&nbsp;the&nbsp;permanent&nbsp;structures&nbsp;on
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;holding.&nbsp;A&nbsp;holding&nbsp;is&nbsp;a&nbsp;polygonal&nbsp;area&nbsp;of&nbsp;the&nbsp;map&nbsp;which&nbsp;does&nbsp;not&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intersect&nbsp;with&nbsp;any&nbsp;other&nbsp;holding,&nbsp;but&nbsp;for&nbsp;the&nbsp;time&nbsp;being&nbsp;we&#x27;ll&nbsp;make&nbsp;the&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;simplifying&nbsp;assumption&nbsp;that&nbsp;every&nbsp;holding&nbsp;is&nbsp;a&nbsp;rectangular&nbsp;strip,&nbsp;and&nbsp;that
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;urban&#x27;&nbsp;holdings&nbsp;are&nbsp;of&nbsp;a&nbsp;reasonably&nbsp;standard&nbsp;width&nbsp;(see&nbsp;Viking-period&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;York)&nbsp;and&nbsp;length.&nbsp;Rural&nbsp;holdings&nbsp;(farms,&nbsp;?wood&nbsp;lots)&nbsp;may&nbsp;be&nbsp;much&nbsp;larger.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
031&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;###&nbsp;Terrain
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;building&nbsp;is&nbsp;made&nbsp;of&nbsp;the&nbsp;stuff&nbsp;of&nbsp;the&nbsp;place.&nbsp;In&nbsp;a&nbsp;forest,&nbsp;buildings&nbsp;will&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tend&nbsp;to&nbsp;be&nbsp;wooden;&nbsp;in&nbsp;a&nbsp;terrain&nbsp;with&nbsp;rocky&nbsp;outcrops&nbsp;--&nbsp;normally&nbsp;found&nbsp;on&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;steep&nbsp;slopes&nbsp;--&nbsp;stone.&nbsp;On&nbsp;the&nbsp;flat&nbsp;lands&nbsp;where&nbsp;there&#x27;s&nbsp;river&nbsp;mud,&nbsp;of&nbsp;brick,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cob,&nbsp;or&nbsp;wattle&nbsp;and&nbsp;daub.&nbsp;So&nbsp;to&nbsp;build&nbsp;a&nbsp;building&nbsp;we&nbsp;need&nbsp;to&nbsp;know&nbsp;the&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;terrain.&nbsp;Terrain&nbsp;can&nbsp;be&nbsp;inferred&nbsp;from&nbsp;location&nbsp;but&nbsp;in&nbsp;practice&nbsp;this&nbsp;will&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;computationally&nbsp;expensive,&nbsp;so&nbsp;we&#x27;ll&nbsp;pass&nbsp;terrain&nbsp;in&nbsp;as&nbsp;an&nbsp;argument&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;build&nbsp;function.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
041&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;the&nbsp;time&nbsp;being&nbsp;we&#x27;ll&nbsp;pass&nbsp;it&nbsp;in&nbsp;simply&nbsp;as&nbsp;a&nbsp;keyword&nbsp;from&nbsp;a&nbsp;defined&nbsp;set
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;keywords;&nbsp;later&nbsp;it&nbsp;may&nbsp;be&nbsp;a&nbsp;more&nbsp;sophisticated&nbsp;data&nbsp;structure.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
044&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;###&nbsp;Culture
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;People&nbsp;of&nbsp;different&nbsp;cultures&nbsp;build&nbsp;distinctively&nbsp;different&nbsp;buildings,&nbsp;even
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when&nbsp;using&nbsp;the&nbsp;same&nbsp;materials.&nbsp;So,&nbsp;in&nbsp;our&nbsp;world,&nbsp;a&nbsp;Japanese&nbsp;wooden&nbsp;house&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;looks&nbsp;quite&nbsp;different&nbsp;from&nbsp;an&nbsp;Anglo&nbsp;Saxon&nbsp;stave&nbsp;house&nbsp;which&nbsp;looks&nbsp;quite&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;different&nbsp;from&nbsp;a&nbsp;Canadian&nbsp;log&nbsp;cabin,&nbsp;even&nbsp;though&nbsp;the&nbsp;materials&nbsp;are&nbsp;much&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same&nbsp;and&nbsp;the&nbsp;tools&nbsp;available&nbsp;to&nbsp;build&nbsp;with&nbsp;are&nbsp;not&nbsp;much&nbsp;different.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
052&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Culture&nbsp;can&nbsp;affect&nbsp;not&nbsp;just&nbsp;the&nbsp;overall&nbsp;shape&nbsp;of&nbsp;a&nbsp;building&nbsp;but&nbsp;also&nbsp;its&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finish&nbsp;and&nbsp;surface&nbsp;detail.&nbsp;For&nbsp;example,&nbsp;in&nbsp;many&nbsp;places&nbsp;in&nbsp;England,&nbsp;stone
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buildings&nbsp;are&nbsp;typically&nbsp;left&nbsp;bare;&nbsp;in&nbsp;rural&nbsp;Scotland,&nbsp;typically&nbsp;painted&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;white&nbsp;or&nbsp;in&nbsp;pastel&nbsp;shades;&nbsp;in&nbsp;Ireland,&nbsp;often&nbsp;quite&nbsp;vivid&nbsp;colours.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
057&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;People&nbsp;may&nbsp;also&nbsp;show&nbsp;religious&nbsp;or&nbsp;cultural&nbsp;symbols&nbsp;on&nbsp;their&nbsp;buildings.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;all&nbsp;these&nbsp;reasons,&nbsp;we&nbsp;need&nbsp;to&nbsp;know&nbsp;the&nbsp;culture&nbsp;of&nbsp;the&nbsp;occupant&nbsp;when
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;creating&nbsp;a&nbsp;building.&nbsp;Again,&nbsp;this&nbsp;will&nbsp;initially&nbsp;be&nbsp;passed&nbsp;in&nbsp;as&nbsp;a&nbsp;keyword.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
062&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;###&nbsp;Craft
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
064&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;People&nbsp;in&nbsp;the&nbsp;game&nbsp;world&nbsp;have&nbsp;a&nbsp;craft,&nbsp;and&nbsp;some&nbsp;crafts&nbsp;will&nbsp;require&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;different&nbsp;features&nbsp;in&nbsp;the&nbsp;building.&nbsp;In&nbsp;the&nbsp;broadly&nbsp;late-bronze-age-to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;medieval&nbsp;period&nbsp;within&nbsp;which&nbsp;the&nbsp;game&nbsp;is&nbsp;set,&nbsp;residence&nbsp;and&nbsp;&nbsp;workplace
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;for&nbsp;most&nbsp;people&nbsp;pretty&nbsp;much&nbsp;the&nbsp;same.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
069&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;So&nbsp;a&nbsp;baker&nbsp;needs&nbsp;an&nbsp;oven,&nbsp;a&nbsp;smith&nbsp;a&nbsp;forge,&nbsp;and&nbsp;so&nbsp;on.&nbsp;All&nbsp;crafts&nbsp;who&nbsp;do
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;some&nbsp;degree&nbsp;retail&nbsp;trade&nbsp;will&nbsp;want&nbsp;a&nbsp;shop&nbsp;front&nbsp;as&nbsp;part&nbsp;of&nbsp;the&nbsp;ground&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;floor&nbsp;of&nbsp;their&nbsp;dwelling.&nbsp;Merchants&nbsp;and&nbsp;bankers&nbsp;will&nbsp;probably&nbsp;have&nbsp;houses
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;are&nbsp;a&nbsp;bit&nbsp;more&nbsp;showy&nbsp;than&nbsp;others.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
074&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Whether&nbsp;the&nbsp;&#x27;genetic&nbsp;buildings&#x27;&nbsp;idea&nbsp;will&nbsp;ever&nbsp;really&nbsp;produce&nbsp;suitable
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buildings&nbsp;for&nbsp;aristons&nbsp;I&nbsp;don&#x27;t&nbsp;know;&nbsp;it&nbsp;seems&nbsp;more&nbsp;likely&nbsp;that&nbsp;significant
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strongholds&nbsp;(of&nbsp;which&nbsp;there&nbsp;will&nbsp;be&nbsp;relatively&nbsp;few)&nbsp;should&nbsp;all&nbsp;be&nbsp;hand
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modelled&nbsp;rather&nbsp;than&nbsp;procedurally&nbsp;generated.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.holdings.holding&nbsp;:refer&nbsp;[ProtoHolding]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.location.location&nbsp;:refer&nbsp;[ProtoLocation]])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;(:import&nbsp;[org.apache.commons.math3.random&nbsp;MersenneTwister]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
082&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
083&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
084&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*terrain-types*&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&quot;Types&nbsp;of&nbsp;terrain&nbsp;which&nbsp;affect&nbsp;building&nbsp;families.&nbsp;TODO:&nbsp;This&nbsp;is&nbsp;a&nbsp;placeholder;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;more&nbsp;sophisticated&nbsp;model&nbsp;will&nbsp;be&nbsp;needed.&quot;
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;#{:arable&nbsp;:arid&nbsp;:forest&nbsp;:plateau&nbsp;:upland})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
088&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
089&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*cultures*
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&quot;Cultures&nbsp;which&nbsp;affect&nbsp;building&nbsp;families.&nbsp;TODO:&nbsp;placeholder&quot;
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;#{:ariston&nbsp;:coastal&nbsp;:steppe-clans&nbsp;:western-clans&nbsp;:wild-herd})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
092&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
093&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*crafts*
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&quot;Crafts&nbsp;which&nbsp;affect&nbsp;building&nbsp;types&nbsp;in&nbsp;the&nbsp;game.&nbsp;See&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`Populating&nbsp;a&nbsp;game&nbsp;world`.&nbsp;TODO:&nbsp;placeholder&quot;
</span><br/>
<span class="covered" title="14 out of 14 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;#{:baker&nbsp;:banker&nbsp;:butcher&nbsp;:chancellor&nbsp;:innkeeper&nbsp;:lawyer&nbsp;:magus&nbsp;:merchant&nbsp;:miller&nbsp;:priest&nbsp;:scholar&nbsp;:smith&nbsp;:weaver})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
097&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
098&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*building-families*&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&quot;Families&nbsp;of&nbsp;buildings.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;family&nbsp;has
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;terrain&nbsp;types&nbsp;to&nbsp;which&nbsp;it&nbsp;is&nbsp;appropriate;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;crafts&nbsp;to&nbsp;which&nbsp;it&nbsp;is&nbsp;appropriate;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;cultures&nbsp;to&nbsp;which&nbsp;it&nbsp;is&nbsp;appropriate.&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;generated&nbsp;building&nbsp;will&nbsp;be&nbsp;of&nbsp;one&nbsp;family,&nbsp;and&nbsp;will&nbsp;comprise&nbsp;modules&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;taken&nbsp;only&nbsp;from&nbsp;that&nbsp;family.&quot;
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;{:pitched-rectangular&nbsp;{:terrains&nbsp;#{:arable&nbsp;:forest&nbsp;:upland}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
110&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;:crafts&nbsp;*crafts*
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
111&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;:cultures&nbsp;#{:coastal&nbsp;:western-clans}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
112&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;:modules&nbsp;[]}
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:flatroof-rectangular&nbsp;{:terrains&nbsp;#{:arid&nbsp;:plateau}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
114&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;:crafts&nbsp;*crafts*
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
115&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;:cultures&nbsp;#{:coastal}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
116&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;:modules&nbsp;[]}})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
117&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
118&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
119&nbsp;&nbsp;(defn&nbsp;building-family
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&quot;A&nbsp;building&nbsp;family&nbsp;is&nbsp;essentially&nbsp;a&nbsp;collection&nbsp;of&nbsp;models&nbsp;of&nbsp;building&nbsp;modules
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;can&nbsp;be&nbsp;assembled&nbsp;to&nbsp;create&nbsp;buildings&nbsp;of&nbsp;a&nbsp;particular&nbsp;structural&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;architectural&nbsp;style.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;[terrain&nbsp;culture&nbsp;craft&nbsp;gene]
</span><br/>
<span class="partial" title="12 out of 13 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[candidates&nbsp;(filter&nbsp;#(and
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
125&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;((:terrains&nbsp;%)&nbsp;terrain)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
126&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;((:crafts&nbsp;%)&nbsp;craft)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
127&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;((:cultures&nbsp;%)&nbsp;culture))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
128&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;(vals&nbsp;*building-families*))]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth&nbsp;candidates&nbsp;(mod&nbsp;(Math&#x2F;abs&nbsp;(.nextInt&nbsp;gene))&nbsp;(count&nbsp;candidates)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
130&nbsp;&nbsp;
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
131&nbsp;&nbsp;(building-family&nbsp;:arable&nbsp;:coastal&nbsp;:baker&nbsp;(MersenneTwister.&nbsp;5))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
132&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
133&nbsp;&nbsp;(defn&nbsp;build!&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&quot;Builds&nbsp;a&nbsp;building,&nbsp;and&nbsp;returns&nbsp;a&nbsp;data&nbsp;structure&nbsp;which&nbsp;represents&nbsp;it.&nbsp;In&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;building&nbsp;the&nbsp;building,&nbsp;it&nbsp;adds&nbsp;a&nbsp;model&nbsp;of&nbsp;the&nbsp;building&nbsp;to&nbsp;the&nbsp;representation
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;world,&nbsp;so&nbsp;it&nbsp;does&nbsp;have&nbsp;a&nbsp;side&nbsp;effect.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;[holding&nbsp;terrain&nbsp;culture&nbsp;craft&nbsp;size]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(satisfies?&nbsp;ProtoHolding&nbsp;holding)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[location&nbsp;(.building-origin&nbsp;holding)
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gene&nbsp;(MersenneTwister.&nbsp;(int&nbsp;(+&nbsp;(*&nbsp;(.easting&nbsp;location)&nbsp;1000000)&nbsp;(.northing&nbsp;location))))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;family&nbsp;(building-family&nbsp;terrain&nbsp;culture&nbsp;craft&nbsp;gene)]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
142&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(instance?&nbsp;ProtoLocation&nbsp;location)&nbsp;(:orientation&nbsp;location))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stuff
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:nonsense
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
146&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:froboz))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
148&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
149&nbsp;&nbsp;;;&nbsp;(def&nbsp;ol&nbsp;(cc.journeyman.the-great-game.location.location&#x2F;OrientedLocation.&nbsp;123.45&nbsp;543.76&nbsp;12.34&nbsp;0.00&nbsp;{}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
150&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,227 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/gossip/gossip.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.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;gossip&nbsp;agents.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note&nbsp;that&nbsp;habitual&nbsp;travellers&nbsp;are&nbsp;all&nbsp;gossip&nbsp;agents;&nbsp;specifically,&nbsp;at&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stage,&nbsp;that&nbsp;means&nbsp;merchants.&nbsp;When&nbsp;merchants&nbsp;are&nbsp;moved&nbsp;we&nbsp;also&nbsp;need&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update&nbsp;the&nbsp;location&nbsp;of&nbsp;the&nbsp;gossip&nbsp;with&nbsp;the&nbsp;same&nbsp;key.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Innkeepers&nbsp;are&nbsp;also&nbsp;gossip&nbsp;agents&nbsp;but&nbsp;do&nbsp;not&nbsp;typically&nbsp;move.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[deep-merge]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.gossip.news-items&nbsp;:refer&nbsp;[learn-news-item]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
012&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
013&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
014&nbsp;&nbsp;(defn&nbsp;dialogue
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&quot;Dialogue&nbsp;between&nbsp;an&nbsp;`enquirer`&nbsp;and&nbsp;an&nbsp;`agent`&nbsp;in&nbsp;this&nbsp;`world`;&nbsp;returns&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;map&nbsp;identical&nbsp;to&nbsp;`enquirer`&nbsp;except&nbsp;that&nbsp;its&nbsp;`:gossip`&nbsp;collection&nbsp;may&nbsp;have
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;additional&nbsp;entries.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;not&nbsp;yet&nbsp;written,&nbsp;this&nbsp;is&nbsp;a&nbsp;stub.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;[enquirer&nbsp;respondent&nbsp;world]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;enquirer)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
021&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
022&nbsp;&nbsp;(defn&nbsp;gather-news
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&quot;Gather&nbsp;news&nbsp;for&nbsp;the&nbsp;specified&nbsp;`gossip`&nbsp;in&nbsp;this&nbsp;`world`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;[world&nbsp;gossip]
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[g&nbsp;(cond&nbsp;(keyword?&nbsp;gossip)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:gossips&nbsp;gossip)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;gossip)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gossip)]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;g
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:gossips
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{(:id&nbsp;g)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{}
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(dialogue&nbsp;g&nbsp;%&nbsp;world)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(=&nbsp;g&nbsp;%)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(=&nbsp;(:location&nbsp;%)&nbsp;(:location&nbsp;g))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(vals&nbsp;(:gossips&nbsp;world))))))}}
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{})))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
043&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
044&nbsp;&nbsp;(defn&nbsp;move-gossip
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`&nbsp;but&nbsp;with&nbsp;this&nbsp;`gossip`&nbsp;moved&nbsp;to&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&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">
047&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">
048&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
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;below&nbsp;does&nbsp;NOT&nbsp;call&nbsp;this&nbsp;function.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;[gossip&nbsp;world&nbsp;new-location]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[id&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;gossip)
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:gossips&nbsp;gossip&nbsp;:id)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;gossip)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gossip)]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;(deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:gossips
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{id
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:location&nbsp;new-location}}})))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
061&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
062&nbsp;&nbsp;(defn&nbsp;run
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`,&nbsp;with&nbsp;news&nbsp;items&nbsp;exchanged&nbsp;between&nbsp;gossip
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;agents.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;[world]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(gather-news&nbsp;world&nbsp;%)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;(:gossips&nbsp;world)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
072&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
073&nbsp;&nbsp;
</span><br/>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,146 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/holdings/holding.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.holdings.holding
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.agent.agent&nbsp;:refer&nbsp;[ProtoAgent]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.objects.container&nbsp;:refer&nbsp;[ProtoContainer]]
</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;[cc.journeyman.the-great-game.objects.game-object&nbsp;:refer&nbsp;[ProtoObject]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.location.location&nbsp;:refer&nbsp;[OrientedLocation]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.world.routes&nbsp;:refer&nbsp;[]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;;&nbsp;A&nbsp;holding&nbsp;is&nbsp;a&nbsp;polygonal&nbsp;area&nbsp;of&nbsp;the&nbsp;map&nbsp;which&nbsp;does&nbsp;not
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;;&nbsp;intersect&nbsp;with&nbsp;any&nbsp;other&nbsp;holding,&nbsp;or&nbsp;with&nbsp;any&nbsp;road&nbsp;or&nbsp;water&nbsp;feature.&nbsp;For&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;&nbsp;the&nbsp;time&nbsp;being&nbsp;we&#x27;ll&nbsp;make&nbsp;the&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;&nbsp;simplifying&nbsp;assumption&nbsp;that&nbsp;every&nbsp;holding&nbsp;is&nbsp;a&nbsp;rectangular&nbsp;strip,&nbsp;and&nbsp;that
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;&nbsp;&#x27;urban&#x27;&nbsp;holdings&nbsp;are&nbsp;of&nbsp;a&nbsp;reasonably&nbsp;standard&nbsp;width&nbsp;(see&nbsp;Viking-period&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;&nbsp;York)&nbsp;and&nbsp;length.&nbsp;Rural&nbsp;holdings&nbsp;(farms,&nbsp;?wood&nbsp;lots)&nbsp;may&nbsp;be&nbsp;much&nbsp;larger.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
014&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
015&nbsp;&nbsp;(defprotocol&nbsp;ProtoHolding
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;(frontage
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[holding]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Returns&nbsp;a&nbsp;sequence&nbsp;of&nbsp;two&nbsp;locations&nbsp;representing&nbsp;the&nbsp;edge&nbsp;of&nbsp;the&nbsp;polygon
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;defines&nbsp;this&nbsp;holding&nbsp;which&nbsp;is&nbsp;considered&nbsp;to&nbsp;be&nbsp;the&nbsp;front.&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;(building-origin
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[holding]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Returns&nbsp;an&nbsp;oriented&nbsp;location&nbsp;-&nbsp;normally&nbsp;the&nbsp;right&nbsp;hand&nbsp;end&nbsp;of&nbsp;the&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frontage,&nbsp;for&nbsp;an&nbsp;urban&nbsp;holding&nbsp;-&nbsp;from&nbsp;which&nbsp;buildings&nbsp;on&nbsp;the&nbsp;holding
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;should&nbsp;be&nbsp;built.&quot;))
</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;(defrecord&nbsp;Holding&nbsp;[perimeter&nbsp;holder]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Perimeter&nbsp;should&nbsp;be&nbsp;a&nbsp;list&nbsp;of&nbsp;locations&nbsp;in&nbsp;exactly&nbsp;the&nbsp;same&nbsp;sense&nbsp;as&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;route&nbsp;in&nbsp;`cc.journeyman.the-great-game.world.routes`.&nbsp;Some&nbsp;sanity&nbsp;checking
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;is&nbsp;needed&nbsp;to&nbsp;ensure&nbsp;this!
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;ProtoContainer
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;ProtoHolding
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;(frontage&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[holding]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TODO:&nbsp;this&nbsp;is&nbsp;WRONG,&nbsp;but&nbsp;will&nbsp;work&nbsp;for&nbsp;now.&nbsp;The&nbsp;frontage&nbsp;should
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;the&nbsp;side&nbsp;of&nbsp;the&nbsp;perimeter&nbsp;nearest&nbsp;to&nbsp;the&nbsp;nearest&nbsp;existing&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;route.&quot;
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(first&nbsp;(perimeter&nbsp;holding))&nbsp;(nth&nbsp;(perimeter&nbsp;holding)&nbsp;1)])
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;(building-origin&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[holding]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TODO:&nbsp;again&nbsp;this&nbsp;is&nbsp;WRONG.&nbsp;The&nbsp;default&nbsp;building&nbsp;origin&nbsp;for&nbsp;rectangular&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buildings&nbsp;should&nbsp;be&nbsp;the&nbsp;right&nbsp;hand&nbsp;end&nbsp;of&nbsp;the&nbsp;frontage&nbsp;when&nbsp;viewed
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;outside&nbsp;the&nbsp;holding.&nbsp;But&nbsp;that&#x27;s&nbsp;not&nbsp;general;&nbsp;celtic-style&nbsp;circular
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buildings&nbsp;should&nbsp;normally&nbsp;be&nbsp;in&nbsp;the&nbsp;centre&nbsp;of&nbsp;their&nbsp;holdings.&nbsp;So&nbsp;probably
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;building-origin&nbsp;becomes&nbsp;a&nbsp;method&nbsp;of&nbsp;building-family&nbsp;rather&nbsp;than&nbsp;of&nbsp;holding.&quot;
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(first&nbsp;(frontage&nbsp;holding)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;ProtoObject)
</span><br/>
</body>
</html>

View file

@ -0,0 +1,143 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/location/location.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.location.location)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
002&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;;;;&nbsp;There&#x27;s&nbsp;probably&nbsp;conflict&nbsp;between&nbsp;this&nbsp;sense&nbsp;of&nbsp;a&nbsp;reified&nbsp;location&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;;;;&nbsp;the&nbsp;simpler&nbsp;sense&nbsp;of&nbsp;a&nbsp;location&nbsp;described&nbsp;in&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;;&nbsp;`cc.journeyman.the-great-game.world.location`,&nbsp;q.v.&nbsp;This&nbsp;needs&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;;&nbsp;be&nbsp;resolved!
</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;(defprotocol&nbsp;ProtoLocation
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;(easting&nbsp;[location]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;easting&nbsp;of&nbsp;this&nbsp;location&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;(northing&nbsp;[location]&nbsp;&quot;Return&nbsp;the&nbsp;northing&nbsp;of&nbsp;this&nbsp;location&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;(altitude&nbsp;[location]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;absolute&nbsp;altitude&nbsp;of&nbsp;this&nbsp;location,&nbsp;which&nbsp;may&nbsp;be
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;different&nbsp;from&nbsp;the&nbsp;terrain&nbsp;height&nbsp;at&nbsp;this&nbsp;location,&nbsp;if,&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;example,&nbsp;the&nbsp;location&nbsp;is&nbsp;underground&nbsp;or&nbsp;on&nbsp;an&nbsp;upper&nbsp;floor.&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;(terrain-altitude&nbsp;[location]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;&#x27;ground&nbsp;level&#x27;&nbsp;(altitude&nbsp;of&nbsp;the&nbsp;terrain)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;this&nbsp;location&nbsp;given&nbsp;this&nbsp;world.&nbsp;TODO:&nbsp;possibly
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;terrain-altitude&nbsp;should&nbsp;be&nbsp;a&nbsp;method&nbsp;of&nbsp;the&nbsp;world.&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;(settlement&nbsp;[location]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;settlement&nbsp;record&nbsp;of&nbsp;the&nbsp;settlement&nbsp;in&nbsp;this&nbsp;world
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;within&nbsp;whose&nbsp;parish&nbsp;polygon&nbsp;this&nbsp;location&nbsp;exists,&nbsp;or&nbsp;if&nbsp;none
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;whose&nbsp;centre&nbsp;(inn&nbsp;location)&nbsp;is&nbsp;closest&nbsp;to&nbsp;this&nbsp;location&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
024&nbsp;&nbsp;
</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;(defrecord&nbsp;Location&nbsp;[^Double&nbsp;easting&nbsp;^Double&nbsp;northing&nbsp;^Double&nbsp;altitude&nbsp;world]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;ProtoLocation
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;(easting&nbsp;[l]&nbsp;(:easting&nbsp;l))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;(northing&nbsp;[l]&nbsp;(:northing&nbsp;l))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;(altitude&nbsp;[l]&nbsp;(:altitude&nbsp;l))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;(terrain-altitude&nbsp;[l]&nbsp;0.0)&nbsp;;;&nbsp;TODO
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;(settlement&nbsp;[l]&nbsp;:tchahua))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(defrecord&nbsp;OrientedLocation
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&quot;Identical&nbsp;to&nbsp;a&nbsp;Location&nbsp;except&nbsp;having,&nbsp;additionally,&nbsp;an&nbsp;orientation&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[^Double&nbsp;easting&nbsp;^Double&nbsp;northing&nbsp;^Double&nbsp;altitude&nbsp;^Double&nbsp;orientation&nbsp;world]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;ProtoLocation
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;(easting&nbsp;[l]&nbsp;(:easting&nbsp;l))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;(northing&nbsp;[l]&nbsp;(:northing&nbsp;l))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;(altitude&nbsp;[l]&nbsp;(:altitude&nbsp;l))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(terrain-altitude&nbsp;[l]&nbsp;0.0)&nbsp;;;&nbsp;TODO
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;(settlement&nbsp;[l]&nbsp;:tchahua))&nbsp;;;&nbsp;TODO
</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;(.settlement&nbsp;(OrientedLocation.&nbsp;123.45&nbsp;543.76&nbsp;12.34&nbsp;0.00&nbsp;{}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,260 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/merchants/markets.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.merchants.markets
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Adjusting&nbsp;quantities&nbsp;and&nbsp;prices&nbsp;in&nbsp;markets.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[taoensso.timbre&nbsp;:as&nbsp;l&nbsp;:refer&nbsp;[info&nbsp;error]]
</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;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[deep-merge]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
005&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
006&nbsp;&nbsp;(defn&nbsp;new-price
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&quot;If&nbsp;`stock`&nbsp;is&nbsp;greater&nbsp;than&nbsp;the&nbsp;maximum&nbsp;of&nbsp;`supply`&nbsp;and&nbsp;`demand`,&nbsp;then
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;there&nbsp;is&nbsp;surplus&nbsp;and&nbsp;`old`&nbsp;price&nbsp;is&nbsp;too&nbsp;high,&nbsp;so&nbsp;shold&nbsp;be&nbsp;reduced.&nbsp;If
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;lower,&nbsp;then&nbsp;it&nbsp;is&nbsp;too&nbsp;low&nbsp;and&nbsp;should&nbsp;be&nbsp;increased.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;[old&nbsp;stock&nbsp;supply&nbsp;demand]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;(let
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[delta&nbsp;(dec&#x27;&nbsp;(&#x2F;&nbsp;(max&nbsp;supply&nbsp;demand&nbsp;1)&nbsp;(max&nbsp;stock&nbsp;1)))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scaled&nbsp;(&#x2F;&nbsp;delta&nbsp;100)]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(+&nbsp;old&nbsp;scaled)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
015&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
016&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
017&nbsp;&nbsp;(defn&nbsp;adjust-quantity-and-price
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&quot;Adjust&nbsp;the&nbsp;quantity&nbsp;of&nbsp;this&nbsp;`commodity`&nbsp;currently&nbsp;in&nbsp;stock&nbsp;in&nbsp;this&nbsp;`city`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;this&nbsp;`world`.&nbsp;Return&nbsp;a&nbsp;fragmentary&nbsp;world&nbsp;which&nbsp;can&nbsp;be&nbsp;deep-merged&nbsp;into
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;world.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;[world&nbsp;city&nbsp;commodity]
</span><br/>
<span class="partial" title="2 out of 4 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[c&nbsp;(cond
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;city)&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;city)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;city)&nbsp;city)
</span><br/>
<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="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="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="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="3 out of 3 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="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">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;if&nbsp;we&#x27;ve&nbsp;two&nbsp;turns&#x27;&nbsp;production&nbsp;of&nbsp;this&nbsp;commodity&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;stock,&nbsp;halt&nbsp;production
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&gt;&nbsp;st&nbsp;(*&nbsp;su&nbsp;2))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;if&nbsp;it&nbsp;is&nbsp;profitable&nbsp;to&nbsp;produce&nbsp;this&nbsp;commodity,&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;craftspeople&nbsp;of&nbsp;the&nbsp;city&nbsp;will&nbsp;do&nbsp;so.
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&gt;&nbsp;p&nbsp;1)&nbsp;su
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;otherwise,&nbsp;if&nbsp;there&nbsp;isn&#x27;t&nbsp;a&nbsp;turn&#x27;s&nbsp;production&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;stock,&nbsp;top&nbsp;up&nbsp;the&nbsp;stock,&nbsp;so&nbsp;that&nbsp;there&#x27;s&nbsp;something&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;incoming&nbsp;merchants&nbsp;to&nbsp;buy
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&gt;&nbsp;su&nbsp;st)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&nbsp;su&nbsp;st)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;(new-price&nbsp;p&nbsp;st&nbsp;su&nbsp;d)]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(not=&nbsp;p&nbsp;n)
</span><br/>
<span class="covered" title="25 out of 25 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;Price&nbsp;of&quot;&nbsp;commodity&nbsp;&quot;at&quot;&nbsp;id&nbsp;&quot;has&nbsp;changed&nbsp;from&quot;&nbsp;(float&nbsp;p)&nbsp;&quot;to&quot;&nbsp;(float&nbsp;n)))
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cities&nbsp;{id
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:stock
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{commodity&nbsp;(+&nbsp;(-&nbsp;st&nbsp;decrement)&nbsp;increment)}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:prices
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{commodity&nbsp;n}}}}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
055&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
056&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
057&nbsp;&nbsp;(defn&nbsp;update-markets
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`,&nbsp;with&nbsp;quantities&nbsp;and&nbsp;prices&nbsp;in&nbsp;markets
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;updated&nbsp;to&nbsp;reflect&nbsp;supply&nbsp;and&nbsp;demand.&nbsp;If&nbsp;`city`&nbsp;or&nbsp;`city`&nbsp;and&nbsp;`commodity`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;specified,&nbsp;return&nbsp;a&nbsp;fragmentary&nbsp;world&nbsp;with&nbsp;only&nbsp;the&nbsp;changes&nbsp;for&nbsp;that
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;`city`&nbsp;(and&nbsp;`commodity`&nbsp;if&nbsp;specified)&nbsp;populated.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;([world]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<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="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="covered" title="2 out of 2 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{}
</span><br/>
<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="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="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">
077&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
078&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
079&nbsp;&nbsp;(defn&nbsp;run
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`,&nbsp;with&nbsp;quantities&nbsp;and&nbsp;prices&nbsp;in&nbsp;markets
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;updated&nbsp;to&nbsp;reflect&nbsp;supply&nbsp;and&nbsp;demand.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;[world]
</span><br/>
<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">
084&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,326 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/merchants/merchant_utils.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.merchants.merchant-utils
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Useful&nbsp;functions&nbsp;for&nbsp;doing&nbsp;low-level&nbsp;things&nbsp;with&nbsp;merchants.&quot;)
</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;(defn&nbsp;expected-price
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&quot;Find&nbsp;the&nbsp;price&nbsp;anticipated,&nbsp;given&nbsp;this&nbsp;`world`,&nbsp;by&nbsp;this&nbsp;`merchant`&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;`commodity`&nbsp;in&nbsp;this&nbsp;`city`.&nbsp;If&nbsp;no&nbsp;information,&nbsp;assume&nbsp;1.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;`merchant`&nbsp;should&nbsp;be&nbsp;passed&nbsp;as&nbsp;a&nbsp;map,&nbsp;`commodity`&nbsp;and&nbsp;`city`&nbsp;should&nbsp;be&nbsp;passed&nbsp;as&nbsp;keywords.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;commodity&nbsp;city]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;(or
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:price
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(last
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sort-by
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:date
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;merchant&nbsp;:known-prices&nbsp;city&nbsp;commodity))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
016&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
017&nbsp;&nbsp;(defn&nbsp;burden
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;total&nbsp;weight&nbsp;of&nbsp;the&nbsp;current&nbsp;cargo&nbsp;carried&nbsp;by&nbsp;this&nbsp;`merchant`&nbsp;in&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;`world`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cargo&nbsp;(or&nbsp;(:stock&nbsp;m)&nbsp;{})]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(*&nbsp;(cargo&nbsp;%)&nbsp;(-&gt;&nbsp;world&nbsp;:commodities&nbsp;%&nbsp;:weight))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;cargo)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
034&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
035&nbsp;&nbsp;(defn&nbsp;can-carry
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;number&nbsp;of&nbsp;units&nbsp;of&nbsp;this&nbsp;`commodity`&nbsp;which&nbsp;this&nbsp;`merchant`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;carry&nbsp;in&nbsp;this&nbsp;`world`,&nbsp;given&nbsp;their&nbsp;current&nbsp;burden.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world&nbsp;commodity]
</span><br/>
<span class="partial" title="3 out of 4 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(max
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(quot
</span><br/>
<span class="partial" title="12 out of 13 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&nbsp;(or&nbsp;(:capacity&nbsp;m)&nbsp;0)&nbsp;(burden&nbsp;m&nbsp;world))
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:commodities&nbsp;commodity&nbsp;:weight)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
049&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
050&nbsp;&nbsp;(defn&nbsp;can-afford
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;number&nbsp;of&nbsp;units&nbsp;of&nbsp;this&nbsp;`commodity`&nbsp;which&nbsp;this&nbsp;`merchant`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;afford&nbsp;to&nbsp;buy&nbsp;in&nbsp;this&nbsp;`world`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world&nbsp;commodity]
</span><br/>
<span class="partial" title="3 out of 4 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;l&nbsp;(:location&nbsp;m)]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nil?&nbsp;m)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;&quot;No&nbsp;merchant?&quot;))
</span><br/>
<span class="covered" title="14 out of 14 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(or&nbsp;(nil?&nbsp;l)&nbsp;(nil?&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;l)))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;(str&nbsp;&quot;No&nbsp;known&nbsp;location&nbsp;for&nbsp;merchant&nbsp;&quot;&nbsp;m)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(quot
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:cash&nbsp;m)
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;l&nbsp;:prices&nbsp;commodity)))))
</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;(defn&nbsp;add-stock
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&quot;Where&nbsp;`a`&nbsp;and&nbsp;`b`&nbsp;are&nbsp;both&nbsp;maps&nbsp;all&nbsp;of&nbsp;whose&nbsp;values&nbsp;are&nbsp;numbers,&nbsp;return
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;map&nbsp;whose&nbsp;keys&nbsp;are&nbsp;a&nbsp;union&nbsp;of&nbsp;the&nbsp;keys&nbsp;of&nbsp;`a`&nbsp;and&nbsp;`b`&nbsp;and&nbsp;whose&nbsp;values
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;the&nbsp;sums&nbsp;of&nbsp;their&nbsp;respective&nbsp;values.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;[a&nbsp;b]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merge
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="partial" title="19 out of 20 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(hash-map&nbsp;%&nbsp;(+&nbsp;(or&nbsp;(a&nbsp;%)&nbsp;0)&nbsp;(or&nbsp;(b&nbsp;%)&nbsp;0)))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;b))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
081&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
082&nbsp;&nbsp;(defn&nbsp;add-known-prices
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&quot;Add&nbsp;the&nbsp;current&nbsp;prices&nbsp;at&nbsp;this&nbsp;`merchant`&#x27;s&nbsp;location&nbsp;in&nbsp;the&nbsp;`world`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;a&nbsp;new&nbsp;cache&nbsp;of&nbsp;known&nbsp;prices,&nbsp;and&nbsp;return&nbsp;it.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k&nbsp;(or&nbsp;(:known-prices&nbsp;m)&nbsp;{})
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;l&nbsp;(:location&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d&nbsp;(or&nbsp;(:date&nbsp;world)&nbsp;0)
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;l&nbsp;:prices)]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nil?&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;&quot;No&nbsp;merchant?&quot;))
</span><br/>
<span class="not-covered" title="0 out of 14 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(or&nbsp;(nil?&nbsp;l)&nbsp;(nil?&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;l)))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;(str&nbsp;&quot;No&nbsp;known&nbsp;location&nbsp;for&nbsp;merchant&nbsp;&quot;&nbsp;m)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(hash-map&nbsp;%&nbsp;(apply&nbsp;vector&nbsp;cons&nbsp;{:price&nbsp;(p&nbsp;%)&nbsp;:date&nbsp;d}&nbsp;(k&nbsp;%)))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:commodities&nbsp;keys))))))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,92 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/merchants/merchants.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.merchants.merchants
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Trade&nbsp;planning&nbsp;for&nbsp;merchants,&nbsp;primarily.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[deep-merge]]
</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;[cc.journeyman.the-great-game.merchants.strategies.simple&nbsp;:refer&nbsp;[move-merchant]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[taoensso.timbre&nbsp;:as&nbsp;l]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
006&nbsp;&nbsp;
</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;(defn&nbsp;run
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;partial&nbsp;world&nbsp;based&nbsp;on&nbsp;this&nbsp;`world`,&nbsp;but&nbsp;with&nbsp;each&nbsp;merchant&nbsp;moved.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;[world]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;(try
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(try
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[move-fn&nbsp;(or
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
018&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;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;%&nbsp;:move-fn)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&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;move-merchant)]
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;move-fn&nbsp;(list&nbsp;%&nbsp;world)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;any
</span><br/>
<span class="not-covered" title="0 out of 18 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;error&nbsp;any&nbsp;&quot;Failure&nbsp;while&nbsp;moving&nbsp;merchant&nbsp;&quot;&nbsp;%)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{}))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;(:merchants&nbsp;world))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;any
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;error&nbsp;any&nbsp;&quot;Failure&nbsp;while&nbsp;moving&nbsp;merchants&quot;)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
028&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,485 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/merchants/planning.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.merchants.planning
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Trade&nbsp;planning&nbsp;for&nbsp;merchants,&nbsp;primarily.&nbsp;This&nbsp;follows&nbsp;a&nbsp;simple-minded
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;generate-and-test&nbsp;strategy&nbsp;and&nbsp;currently&nbsp;generates&nbsp;plans&nbsp;for&nbsp;all&nbsp;possible
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;routes&nbsp;from&nbsp;the&nbsp;current&nbsp;location.&nbsp;This&nbsp;may&nbsp;not&nbsp;scale.&nbsp;Also,&nbsp;routes&nbsp;do&nbsp;not
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;currently&nbsp;have&nbsp;cost&nbsp;or&nbsp;risk&nbsp;associated&nbsp;with&nbsp;them.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[deep-merge&nbsp;make-target-filter]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.merchants.merchant-utils&nbsp;:refer&nbsp;[can-afford&nbsp;can-carry&nbsp;expected-price]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.world.routes&nbsp;:refer&nbsp;[find-route]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.world.world&nbsp;:refer&nbsp;[actual-price&nbsp;default-world]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
010&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
011&nbsp;&nbsp;(defn&nbsp;generate-trade-plans
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&quot;Generate&nbsp;all&nbsp;possible&nbsp;trade&nbsp;plans&nbsp;for&nbsp;this&nbsp;`merchant`&nbsp;and&nbsp;this&nbsp;`commodity`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;this&nbsp;`world`.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
014&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;Returned&nbsp;plans&nbsp;are&nbsp;maps&nbsp;with&nbsp;keys:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
016&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:merchant&nbsp;-&nbsp;the&nbsp;id&nbsp;of&nbsp;the&nbsp;`merchant`&nbsp;for&nbsp;whom&nbsp;the&nbsp;plan&nbsp;was&nbsp;created;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:origin&nbsp;-&nbsp;the&nbsp;city&nbsp;from&nbsp;which&nbsp;the&nbsp;trade&nbsp;starts;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:destination&nbsp;-&nbsp;the&nbsp;city&nbsp;to&nbsp;which&nbsp;the&nbsp;trade&nbsp;is&nbsp;planned;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:commodity&nbsp;-&nbsp;the&nbsp;`commodity`&nbsp;to&nbsp;be&nbsp;carried;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:buy-price&nbsp;-&nbsp;the&nbsp;price&nbsp;at&nbsp;which&nbsp;that&nbsp;`commodity`&nbsp;can&nbsp;be&nbsp;bought;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:expected-price&nbsp;-&nbsp;the&nbsp;price&nbsp;at&nbsp;which&nbsp;the&nbsp;`merchant`&nbsp;anticipates
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;`commodity`&nbsp;can&nbsp;be&nbsp;sold;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:distance&nbsp;-&nbsp;the&nbsp;number&nbsp;of&nbsp;stages&nbsp;in&nbsp;the&nbsp;planned&nbsp;journey
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:dist-to-home&nbsp;-&nbsp;the&nbsp;distance&nbsp;from&nbsp;`destination`&nbsp;to&nbsp;the&nbsp;`merchant`&#x27;s
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;home&nbsp;city.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world&nbsp;commodity]
</span><br/>
<span class="partial" title="3 out of 4 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;origin&nbsp;(:location&nbsp;m)]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(hash-map
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:merchant&nbsp;(:id&nbsp;m)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:origin&nbsp;origin
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:destination&nbsp;%
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:commodity&nbsp;commodity
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:buy-price&nbsp;(actual-price&nbsp;world&nbsp;commodity&nbsp;origin)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:expected-price&nbsp;(expected-price
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
042&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;m
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&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;commodity
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&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;%)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:distance&nbsp;(count
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(find-route&nbsp;world&nbsp;origin&nbsp;%))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:dist-to-home&nbsp;(count
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
048&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;(find-route
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
049&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;world
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
050&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;(:home&nbsp;m)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&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;%)))
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;#(=&nbsp;%&nbsp;origin)&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;keys)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
053&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
054&nbsp;&nbsp;(defn&nbsp;nearest-with-targets
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;distance&nbsp;to&nbsp;the&nbsp;nearest&nbsp;destination&nbsp;among&nbsp;those&nbsp;of&nbsp;these
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;`plans`&nbsp;which&nbsp;match&nbsp;these&nbsp;`targets`.&nbsp;Plans&nbsp;are&nbsp;expected&nbsp;to&nbsp;be&nbsp;plans
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;returned&nbsp;by&nbsp;`generate-trade-plans`,&nbsp;q.v.;&nbsp;`targets`&nbsp;are&nbsp;expected&nbsp;to&nbsp;be
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;accepted&nbsp;by&nbsp;`make-target-filter`,&nbsp;q.v.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;[plans&nbsp;targets]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;(apply
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;min
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:distance
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(make-target-filter&nbsp;targets)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plans))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
067&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
068&nbsp;&nbsp;(defn&nbsp;plan-trade
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&quot;Find&nbsp;the&nbsp;best&nbsp;destination&nbsp;in&nbsp;this&nbsp;`world`&nbsp;for&nbsp;this&nbsp;`commodity`&nbsp;given&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;`merchant`&nbsp;and&nbsp;this&nbsp;`origin`.&nbsp;If&nbsp;two&nbsp;cities&nbsp;are&nbsp;anticipated&nbsp;to&nbsp;offer&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;same&nbsp;price,&nbsp;the&nbsp;nearer&nbsp;should&nbsp;be&nbsp;preferred;&nbsp;if&nbsp;two&nbsp;are&nbsp;equally&nbsp;distant,&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;ones&nbsp;nearer&nbsp;to&nbsp;the&nbsp;merchant&#x27;s&nbsp;home&nbsp;should&nbsp;be&nbsp;preferred.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;`merchant`&nbsp;may&nbsp;be&nbsp;passed&nbsp;as&nbsp;a&nbsp;map&nbsp;or&nbsp;a&nbsp;keyword;&nbsp;`commodity`&nbsp;should&nbsp;&nbsp;be
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;passed&nbsp;as&nbsp;a&nbsp;keyword.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
075&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;returned&nbsp;plan&nbsp;is&nbsp;a&nbsp;map&nbsp;with&nbsp;keys:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
077&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:merchant&nbsp;-&nbsp;the&nbsp;id&nbsp;of&nbsp;the&nbsp;`merchant`&nbsp;for&nbsp;whom&nbsp;the&nbsp;plan&nbsp;was&nbsp;created;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:origin&nbsp;-&nbsp;the&nbsp;city&nbsp;from&nbsp;which&nbsp;the&nbsp;trade&nbsp;starts;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:destination&nbsp;-&nbsp;the&nbsp;city&nbsp;to&nbsp;which&nbsp;the&nbsp;trade&nbsp;is&nbsp;planned;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:commodity&nbsp;-&nbsp;the&nbsp;`commodity`&nbsp;to&nbsp;be&nbsp;carried;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:buy-price&nbsp;-&nbsp;the&nbsp;price&nbsp;at&nbsp;which&nbsp;that&nbsp;`commodity`&nbsp;can&nbsp;be&nbsp;bought;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:expected-price&nbsp;-&nbsp;the&nbsp;price&nbsp;at&nbsp;which&nbsp;the&nbsp;`merchant`&nbsp;anticipates
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;`commodity`&nbsp;can&nbsp;be&nbsp;sold;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:distance&nbsp;-&nbsp;the&nbsp;number&nbsp;of&nbsp;stages&nbsp;in&nbsp;the&nbsp;planned&nbsp;journey
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;:dist-to-home&nbsp;-&nbsp;the&nbsp;distance&nbsp;from&nbsp;`destination`&nbsp;to&nbsp;the&nbsp;`merchant`&#x27;s
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;home&nbsp;city.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world&nbsp;commodity]
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[plans&nbsp;(generate-trade-plans&nbsp;merchant&nbsp;world&nbsp;commodity)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;best-prices&nbsp;(filter
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(make-target-filter
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
092&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;[[:expected-price
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
093&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;(apply
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
094&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;max
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
095&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;(filter&nbsp;number?&nbsp;(map&nbsp;:expected-price&nbsp;plans)))]])
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plans)]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(first
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sort-by
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;all&nbsp;other&nbsp;things&nbsp;being&nbsp;equal,&nbsp;a&nbsp;merchant&nbsp;would&nbsp;prefer&nbsp;to&nbsp;end&nbsp;closer
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;to&nbsp;home.
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(-&nbsp;0&nbsp;(:dist-to-home&nbsp;%))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;a&nbsp;merchant&nbsp;will&nbsp;seek&nbsp;the&nbsp;best&nbsp;price,&nbsp;but&nbsp;won&#x27;t&nbsp;go&nbsp;further&nbsp;than
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;needed&nbsp;to&nbsp;get&nbsp;it.
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(make-target-filter
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[:distance
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;min&nbsp;(filter&nbsp;number?&nbsp;(map&nbsp;:distance&nbsp;best-prices)))]])
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;best-prices)))))
</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;augment-plan
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&quot;Augment&nbsp;this&nbsp;`plan`&nbsp;constructed&nbsp;in&nbsp;this&nbsp;`world`&nbsp;for&nbsp;this&nbsp;`merchant`&nbsp;with
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;`:quantity`&nbsp;of&nbsp;goods&nbsp;which&nbsp;should&nbsp;be&nbsp;bought&nbsp;and&nbsp;the&nbsp;`:expected-profit`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;trade.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
114&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;Returns&nbsp;the&nbsp;augmented&nbsp;plan.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
116&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world&nbsp;plan]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[c&nbsp;(:commodity&nbsp;plan)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;(:origin&nbsp;plan)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q&nbsp;(min
</span><br/>
<span class="partial" title="4 out of 5 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(or
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;o&nbsp;:stock&nbsp;c)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(can-carry&nbsp;merchant&nbsp;world&nbsp;c)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(can-afford&nbsp;merchant&nbsp;world&nbsp;c))
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;(*&nbsp;q&nbsp;(-&nbsp;(:expected-price&nbsp;plan)&nbsp;(:buy-price&nbsp;plan)))]
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assoc&nbsp;plan&nbsp;:quantity&nbsp;q&nbsp;:expected-profit&nbsp;p)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
127&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
128&nbsp;&nbsp;(defn&nbsp;select-cargo
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;&quot;A&nbsp;`merchant`,&nbsp;in&nbsp;a&nbsp;given&nbsp;location&nbsp;in&nbsp;a&nbsp;`world`,&nbsp;will&nbsp;choose&nbsp;to&nbsp;buy&nbsp;a&nbsp;cargo
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;within&nbsp;the&nbsp;limit&nbsp;they&nbsp;are&nbsp;capable&nbsp;of&nbsp;carrying,&nbsp;which&nbsp;they&nbsp;can&nbsp;anticipate
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;selling&nbsp;for&nbsp;a&nbsp;profit&nbsp;at&nbsp;a&nbsp;destination.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="partial" title="2 out of 4 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;origin&nbsp;(:location&nbsp;m)
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;origin&nbsp;:stock)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plans&nbsp;(map
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(augment-plan
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(plan-trade&nbsp;m&nbsp;world&nbsp;%))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
146&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(let&nbsp;[q&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;origin&nbsp;:stock&nbsp;%)]
</span><br/>
<span class="partial" title="8 out of 9 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(number?&nbsp;q)&nbsp;(pos?&nbsp;q)))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keys&nbsp;available)))]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(not&nbsp;(empty?&nbsp;plans))
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(first
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sort-by
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(-&nbsp;0&nbsp;(:dist-to-home&nbsp;%))
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(make-target-filter
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[:expected-profit
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;max&nbsp;(filter&nbsp;number?&nbsp;(map&nbsp;:expected-profit&nbsp;plans)))]])
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plans))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
159&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,527 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../../coverage.css"/> <title> cc/journeyman/the_great_game/merchants/strategies/simple.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.merchants.strategies.simple
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Default&nbsp;trading&nbsp;strategy&nbsp;for&nbsp;merchants.
</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;The&nbsp;simple&nbsp;strategy&nbsp;buys&nbsp;a&nbsp;single&nbsp;product&nbsp;in&nbsp;the&nbsp;local&nbsp;market&nbsp;if&nbsp;there&nbsp;is
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;one&nbsp;which&nbsp;can&nbsp;be&nbsp;traded&nbsp;profitably,&nbsp;trades&nbsp;it&nbsp;to&nbsp;the&nbsp;chosen&nbsp;target&nbsp;market,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;sells&nbsp;it&nbsp;there.&nbsp;If&nbsp;there&nbsp;is&nbsp;no&nbsp;commodity&nbsp;locally&nbsp;which&nbsp;can&nbsp;be&nbsp;traded
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;profitably,&nbsp;moves&nbsp;towards&nbsp;home&nbsp;with&nbsp;no&nbsp;cargo.&nbsp;If&nbsp;at&nbsp;home&nbsp;and&nbsp;no&nbsp;commodity
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;be&nbsp;traded&nbsp;profitably,&nbsp;does&nbsp;not&nbsp;move.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[taoensso.timbre&nbsp;:as&nbsp;l&nbsp;:refer&nbsp;[info&nbsp;error&nbsp;spy]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[deep-merge]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.gossip.gossip&nbsp;:refer&nbsp;[move-gossip]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.merchants.planning&nbsp;:refer&nbsp;[augment-plan&nbsp;plan-trade&nbsp;select-cargo]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.merchants.merchant-utils&nbsp;:refer
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[add-stock&nbsp;add-known-prices]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.world.routes&nbsp;:refer&nbsp;[find-route]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
016&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
017&nbsp;&nbsp;(defn&nbsp;plan-and-buy
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`,&nbsp;in&nbsp;which&nbsp;this&nbsp;`merchant`&nbsp;has&nbsp;planned
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;new&nbsp;trade,&nbsp;and&nbsp;bought&nbsp;appropriate&nbsp;stock&nbsp;for&nbsp;it.&nbsp;If&nbsp;no&nbsp;profitable&nbsp;trade
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;be&nbsp;planned,&nbsp;the&nbsp;merchant&nbsp;is&nbsp;simply&nbsp;moved&nbsp;towards&nbsp;their&nbsp;home.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;(:id&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location&nbsp;(:location&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;market&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;location)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plan&nbsp;(select-cargo&nbsp;merchant&nbsp;world)]
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;debug&nbsp;&quot;plan-and-buy:&nbsp;merchant&quot;&nbsp;id)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(seq?&nbsp;plan)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[c&nbsp;(:commodity&nbsp;plan)
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;(*&nbsp;(:quantity&nbsp;plan)&nbsp;(:buy-price&nbsp;plan))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q&nbsp;(:quantity&nbsp;plan)]
</span><br/>
<span class="not-covered" title="0 out of 26 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;Merchant&quot;&nbsp;id&nbsp;&quot;bought&quot;&nbsp;q&nbsp;&quot;units&nbsp;of&quot;&nbsp;c&nbsp;&quot;at&quot;&nbsp;location&nbsp;&quot;for&quot;&nbsp;p&nbsp;plan)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:merchants
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{id
</span><br/>
<span class="not-covered" title="0 out of 13 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:stock&nbsp;(add-stock&nbsp;(:stock&nbsp;m)&nbsp;{c&nbsp;q})
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;(-&nbsp;(:cash&nbsp;m)&nbsp;p)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;(add-known-prices&nbsp;m&nbsp;world)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:plan&nbsp;plan}}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cities
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{location
</span><br/>
<span class="not-covered" title="0 out of 16 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:stock&nbsp;(assoc&nbsp;(:stock&nbsp;market)&nbsp;c&nbsp;(-&nbsp;(-&gt;&nbsp;market&nbsp;:stock&nbsp;c)&nbsp;q))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;(+&nbsp;(:cash&nbsp;market)&nbsp;p)}}})
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;if&nbsp;no&nbsp;plan,&nbsp;then&nbsp;if&nbsp;at&nbsp;home&nbsp;stay&nbsp;put
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(=&nbsp;(:location&nbsp;m)&nbsp;(:home&nbsp;m))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(do
</span><br/>
<span class="not-covered" title="0 out of 19 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;Merchant&quot;&nbsp;id&nbsp;&quot;remains&nbsp;at&nbsp;home&nbsp;in&quot;&nbsp;location)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{})
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;else&nbsp;move&nbsp;towards&nbsp;home
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[route&nbsp;(find-route&nbsp;world&nbsp;location&nbsp;(:home&nbsp;m))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next-location&nbsp;(nth&nbsp;route&nbsp;1)]
</span><br/>
<span class="not-covered" title="0 out of 21 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;No&nbsp;trade&nbsp;possible&nbsp;at&quot;&nbsp;location&nbsp;&quot;;&nbsp;merchant&quot;&nbsp;id&nbsp;&quot;moves&nbsp;to&quot;&nbsp;next-location)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(merge
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:merchants
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{id
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:location&nbsp;next-location}}}
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(move-gossip&nbsp;id&nbsp;world&nbsp;next-location))))))
</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;(defn&nbsp;re-plan
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&quot;Having&nbsp;failed&nbsp;to&nbsp;sell&nbsp;a&nbsp;cargo&nbsp;at&nbsp;current&nbsp;location,&nbsp;re-plan&nbsp;a&nbsp;route&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;sell&nbsp;the&nbsp;current&nbsp;cargo.&nbsp;Returns&nbsp;a&nbsp;revised&nbsp;world.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;(:id&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location&nbsp;(:location&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 13 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plan&nbsp;(augment-plan&nbsp;m&nbsp;world&nbsp;(plan-trade&nbsp;m&nbsp;world&nbsp;(-&gt;&nbsp;m&nbsp;:plan&nbsp;:commodity)))]
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;debug&nbsp;&quot;re-plan:&nbsp;merchant&quot;&nbsp;id)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:merchants
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{id
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:plan&nbsp;plan}}})))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
083&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
084&nbsp;&nbsp;(defn&nbsp;sell-and-buy
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;new&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`,&nbsp;in&nbsp;which&nbsp;this&nbsp;`merchant`&nbsp;has&nbsp;sold
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;their&nbsp;current&nbsp;stock&nbsp;in&nbsp;their&nbsp;current&nbsp;location,&nbsp;and&nbsp;planned&nbsp;a&nbsp;new&nbsp;trade,&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;bought&nbsp;appropriate&nbsp;stock&nbsp;for&nbsp;it.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;this&nbsp;either&nbsp;sells&nbsp;the&nbsp;entire&nbsp;cargo,&nbsp;or,&nbsp;if&nbsp;the&nbsp;market&nbsp;can&#x27;t&nbsp;afford
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;it,&nbsp;none&nbsp;of&nbsp;it.&nbsp;And&nbsp;it&nbsp;does&nbsp;not&nbsp;cope&nbsp;with&nbsp;selling&nbsp;different&nbsp;commodities
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;in&nbsp;different&nbsp;markets.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;(:id&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location&nbsp;(:location&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;market&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;location)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stock-value&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
101&nbsp;&nbsp;&nbsp;&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-covered" title="0 out of 3 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
103&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;(-&gt;&nbsp;m&nbsp;:stock&nbsp;%)&nbsp;(-&gt;&nbsp;market&nbsp;:prices&nbsp;m))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
104&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;(keys&nbsp;(:stock&nbsp;m))))]
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;debug&nbsp;&quot;sell-and-buy:&nbsp;merchant&quot;&nbsp;id)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&gt;=&nbsp;(:cash&nbsp;market)&nbsp;stock-value)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(do
</span><br/>
<span class="not-covered" title="0 out of 25 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;Merchant&quot;&nbsp;id&nbsp;&quot;sells&quot;&nbsp;(:stock&nbsp;m)&nbsp;&quot;at&quot;&nbsp;location&nbsp;&quot;for&quot;&nbsp;stock-value)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(plan-and-buy
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(deep-merge
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:merchants
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{id
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:stock&nbsp;{}
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;(+&nbsp;(:cash&nbsp;m)&nbsp;stock-value)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;(add-known-prices&nbsp;m&nbsp;world)}}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cities
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{location
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:stock&nbsp;(add-stock&nbsp;(:stock&nbsp;m)&nbsp;(:stock&nbsp;market))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;(-&nbsp;(:cash&nbsp;market)&nbsp;stock-value)}}})))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;else
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(re-plan&nbsp;merchant&nbsp;world))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
125&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
126&nbsp;&nbsp;(defn&nbsp;move-merchant
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;&quot;Handle&nbsp;general&nbsp;en&nbsp;route&nbsp;movement&nbsp;of&nbsp;this&nbsp;`merchant`&nbsp;in&nbsp;this&nbsp;`world`;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;a&nbsp;(partial&nbsp;or&nbsp;full)&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`&nbsp;but&nbsp;in&nbsp;which&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;merchant&nbsp;may&nbsp;have&nbsp;been&nbsp;moved&nbsp;ot&nbsp;updated.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;[merchant&nbsp;world]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:merchants&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map?&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;merchant)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;(:id&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 16 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at-destination?&nbsp;(and&nbsp;(:plan&nbsp;m)&nbsp;(=&nbsp;(:location&nbsp;m)&nbsp;(-&gt;&nbsp;m&nbsp;:plan&nbsp;:destination)))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plan&nbsp;(:plan&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next-location&nbsp;(if&nbsp;plan
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
140&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;(nth
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
141&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;(find-route
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
142&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;world
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
143&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;(:location&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
144&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;(:destination&nbsp;plan))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
145&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="not-covered" title="0 out of 3 forms covered">
146&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;(:location&nbsp;m))]
</span><br/>
<span class="not-covered" title="0 out of 24 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;debug&nbsp;&quot;move-merchant:&nbsp;merchant&quot;&nbsp;id&nbsp;&quot;at&quot;&nbsp;(:location&nbsp;m)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;destination&quot;&nbsp;(-&gt;&nbsp;m&nbsp;:plan&nbsp;:destination)&nbsp;&quot;next&quot;&nbsp;next-location
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;at&nbsp;destination&quot;&nbsp;at-destination?)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;if&nbsp;the&nbsp;merchant&nbsp;is&nbsp;at&nbsp;the&nbsp;destination&nbsp;of&nbsp;their&nbsp;current&nbsp;plan
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;sell&nbsp;all&nbsp;cargo&nbsp;and&nbsp;repurchase.
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at-destination?
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sell-and-buy&nbsp;merchant&nbsp;world)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;if&nbsp;they&nbsp;don&#x27;t&nbsp;have&nbsp;a&nbsp;plan,&nbsp;seek&nbsp;to&nbsp;create&nbsp;one
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nil?&nbsp;plan)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(plan-and-buy&nbsp;merchant&nbsp;world)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;otherwise,&nbsp;move&nbsp;one&nbsp;step&nbsp;towards&nbsp;their&nbsp;destination
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;next-location&nbsp;(not=&nbsp;next-location&nbsp;(:location&nbsp;m)))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
160&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(do
</span><br/>
<span class="not-covered" title="0 out of 23 forms covered">
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;Merchant&nbsp;&quot;&nbsp;id&nbsp;&quot;&nbsp;moving&nbsp;from&nbsp;&quot;&nbsp;(:location&nbsp;m)&nbsp;&quot;&nbsp;to&nbsp;&quot;&nbsp;next-location)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(deep-merge
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:merchants
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{id
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:location&nbsp;next-location
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
166&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;(add-known-prices&nbsp;m&nbsp;world)}}}
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
167&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(move-gossip&nbsp;id&nbsp;world&nbsp;next-location)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
168&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(do
</span><br/>
<span class="not-covered" title="0 out of 19 forms covered">
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(l&#x2F;info&nbsp;&quot;Merchant&quot;&nbsp;id&nbsp;&quot;has&nbsp;plan&nbsp;but&nbsp;no&nbsp;next-location;&nbsp;currently&nbsp;at&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:location&nbsp;m)&nbsp;&quot;,&nbsp;destination&nbsp;is&quot;&nbsp;(:destination&nbsp;plan))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
173&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,41 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/objects/container.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.objects.container
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;(:require
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.objects.game-object&nbsp;:refer&nbsp;:all]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
004&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
005&nbsp;&nbsp;(defprotocol&nbsp;ProtoContainer
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;(contents
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[container]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;sequence&nbsp;of&nbsp;the&nbsp;contents&nbsp;of&nbsp;this&nbsp;`container`,&nbsp;or&nbsp;`nil`&nbsp;if&nbsp;empty.&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;(is-empty?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[container]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;`true`&nbsp;if&nbsp;this&nbsp;`container`&nbsp;is&nbsp;empty,&nbsp;else&nbsp;`false`.&quot;))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,71 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/objects/game_object.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.objects.game-object
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Anything&nbsp;at&nbsp;all&nbsp;in&nbsp;the&nbsp;game&nbsp;world&quot;)
</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;(defprotocol&nbsp;ProtoObject
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&quot;An&nbsp;object&nbsp;in&nbsp;the&nbsp;world&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;(id&nbsp;[object]&nbsp;&quot;Returns&nbsp;the&nbsp;unique&nbsp;id&nbsp;of&nbsp;this&nbsp;object.&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;(reify-object
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[object]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Adds&nbsp;this&nbsp;`object`&nbsp;to&nbsp;the&nbsp;global&nbsp;object&nbsp;list.&nbsp;If&nbsp;the&nbsp;`object`&nbsp;has&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-nil&nbsp;value&nbsp;for&nbsp;its&nbsp;`id`&nbsp;method,&nbsp;keys&nbsp;it&nbsp;to&nbsp;that&nbsp;id&nbsp;-&nbsp;**but**&nbsp;if&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;value&nbsp;is&nbsp;already&nbsp;in&nbsp;use,&nbsp;throws&nbsp;a&nbsp;hard&nbsp;exception.&nbsp;Returns&nbsp;the&nbsp;id&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;the&nbsp;object&nbsp;is&nbsp;keyed&nbsp;in&nbsp;the&nbsp;global&nbsp;object&nbsp;list.&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
013&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
014&nbsp;&nbsp;(defrecord&nbsp;GameObject
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[id]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&quot;An&nbsp;object&nbsp;in&nbsp;the&nbsp;world&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;ProtoObject
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;(id&nbsp;[_]&nbsp;id)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;(reify-object&nbsp;[object]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TODO:&nbsp;doesn&#x27;t&nbsp;work&nbsp;yet&quot;
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,224 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../coverage.css"/> <title> cc/journeyman/the_great_game/playroom.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.playroom
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[jme-clj.core&nbsp;:refer&nbsp;[add&nbsp;add-to-root&nbsp;box&nbsp;defsimpleapp&nbsp;fly-cam&nbsp;geo&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&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;&nbsp;&nbsp;&nbsp;get*&nbsp;get-state&nbsp;load-texture&nbsp;rotate&nbsp;run&nbsp;set*&nbsp;
</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setc&nbsp;set-state&nbsp;start&nbsp;unshaded-mat]])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;(:import&nbsp;[com.jme3.math&nbsp;ColorRGBA]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
006&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;&nbsp;At&nbsp;present&nbsp;this&nbsp;file&nbsp;is&nbsp;just&nbsp;somewhere&nbsp;to&nbsp;play&nbsp;around&nbsp;with&nbsp;jme-clj&nbsp;examples
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
008&nbsp;&nbsp;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
009&nbsp;&nbsp;(declare&nbsp;app)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
010&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
011&nbsp;&nbsp;(defn&nbsp;init&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[cube&nbsp;(geo&nbsp;&quot;jMonkey&nbsp;cube&quot;&nbsp;(box&nbsp;1&nbsp;1&nbsp;1))
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mat&nbsp;&nbsp;(unshaded-mat)]
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set*&nbsp;mat&nbsp;:texture&nbsp;&quot;ColorMap&quot;&nbsp;(load-texture&nbsp;&quot;textures&#x2F;Monkey.jpg&quot;))
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set*&nbsp;cube&nbsp;:material&nbsp;mat)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(add-to-root&nbsp;cube)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cube&nbsp;cube}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
018&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;&nbsp;Let&#x27;s&nbsp;create&nbsp;simple-update&nbsp;fn&nbsp;with&nbsp;no&nbsp;body&nbsp;for&nbsp;now.
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
020&nbsp;&nbsp;&nbsp;(defn&nbsp;simple-update&nbsp;[tpf]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[{:keys&nbsp;[cube]}&nbsp;(get-state)]
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(rotate&nbsp;cube&nbsp;0&nbsp;(*&nbsp;2&nbsp;tpf)&nbsp;0)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
023&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
024&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;&nbsp;Kills&nbsp;the&nbsp;running&nbsp;app&nbsp;var&nbsp;and&nbsp;closes&nbsp;its&nbsp;window.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;&nbsp;(unbind-app&nbsp;#&#x27;app)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
027&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;&nbsp;We&nbsp;define&nbsp;the&nbsp;`app`&nbsp;var.
</span><br/>
<span class="partial" title="115 out of 215 forms covered">
029&nbsp;&nbsp;(defsimpleapp&nbsp;app
</span><br/>
<span class="partial" title="36 out of 42 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:opts&nbsp;{:show-settings?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;false
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pause-on-lost-focus?&nbsp;false
</span><br/>
<span class="partial" title="66 out of 77 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:settings&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;My&nbsp;JME&nbsp;Game&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:load-defaults?&nbsp;true
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:frame-rate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;60
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;800
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;600}}
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:init&nbsp;init
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:update&nbsp;simple-update)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
039&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;;;&nbsp;(start&nbsp;app)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
041&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;;;&nbsp;Reinitialises&nbsp;the&nbsp;running&nbsp;app
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;;;(run&nbsp;app
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(re-init&nbsp;init))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;;;&nbsp;By&nbsp;default,&nbsp;there&nbsp;is&nbsp;a&nbsp;Fly&nbsp;Camera&nbsp;attached&nbsp;to&nbsp;the&nbsp;app&nbsp;that&nbsp;you&nbsp;can&nbsp;control&nbsp;with&nbsp;W,&nbsp;A,&nbsp;S&nbsp;and&nbsp;D&nbsp;keys.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;;;&nbsp;Let&#x27;s&nbsp;increase&nbsp;its&nbsp;movement&nbsp;speed.&nbsp;Now,&nbsp;you&nbsp;fly&nbsp;faster&nbsp;:)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;;;&nbsp;(run&nbsp;app
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set*&nbsp;(fly-cam)&nbsp;:move-speed&nbsp;15))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
050&nbsp;&nbsp;
</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;Updates&nbsp;the&nbsp;app&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;;;&nbsp;(run&nbsp;app
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[{:keys&nbsp;[cube]}&nbsp;(get-state)]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set*&nbsp;cube&nbsp;:local-translation&nbsp;(add&nbsp;(get*&nbsp;cube&nbsp;:local-translation)&nbsp;1&nbsp;1&nbsp;1))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
056&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;Updates&nbsp;the&nbsp;app&nbsp;adding&nbsp;a&nbsp;second&nbsp;cube
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;;;&nbsp;(run&nbsp;app
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[cube&nbsp;(geo&nbsp;&quot;jMonkey&nbsp;cube&quot;&nbsp;(box&nbsp;1&nbsp;1&nbsp;1))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mat&nbsp;&nbsp;(unshaded-mat)]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set*&nbsp;mat&nbsp;:texture&nbsp;&quot;ColorMap&quot;&nbsp;(load-texture&nbsp;&quot;textures&#x2F;Monkey.jpg&quot;))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(setc&nbsp;cube
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:material&nbsp;mat
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:local-translation&nbsp;[-3&nbsp;0&nbsp;0])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(add-to-root&nbsp;cube)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set-state&nbsp;:cube2&nbsp;cube)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;;;&nbsp;We&nbsp;added&nbsp;the&nbsp;new&nbsp;cube,&nbsp;but&nbsp;it&#x27;s&nbsp;not&nbsp;rotating.&nbsp;We&nbsp;need&nbsp;to&nbsp;update&nbsp;the&nbsp;simple-update&nbsp;fn.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;;;&nbsp;(defn&nbsp;simple-update&nbsp;[tpf]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;(let&nbsp;[{:keys&nbsp;[cube&nbsp;cube2]}&nbsp;(get-state)]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(rotate&nbsp;cube&nbsp;0&nbsp;(*&nbsp;2&nbsp;tpf)&nbsp;0)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(rotate&nbsp;cube2&nbsp;0&nbsp;(*&nbsp;2&nbsp;tpf)&nbsp;0)))
</span><br/>
</body>
</html>

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> cc/journeyman/the_great_game/time.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.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="2 out of 2 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="2 out of 2 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="2 out of 2 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="3 out of 3 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="3 out of 3 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="54 out of 54 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="1 out of 1 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="3 out of 3 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="3 out of 3 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="3 out of 3 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="3 out of 3 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="9 out of 9 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="3 out of 3 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="1 out of 1 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,191 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../coverage.css"/> <title> cc/journeyman/the_great_game/utils.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.utils)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
002&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
003&nbsp;&nbsp;(defn&nbsp;cyclic?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;&quot;True&nbsp;if&nbsp;two&nbsp;or&nbsp;more&nbsp;elements&nbsp;of&nbsp;`route`&nbsp;are&nbsp;identical&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;[route]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;(not=&nbsp;(count&nbsp;route)(count&nbsp;(set&nbsp;route))))
</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;(defn&nbsp;deep-merge
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&quot;Recursively&nbsp;merges&nbsp;maps.&nbsp;Stolen&nbsp;from
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;https:&#x2F;&#x2F;dnaeon.github.io&#x2F;recursively-merging-maps-in-clojure&#x2F;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;[&amp;&nbsp;maps]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;(letfn&nbsp;[(m&nbsp;[&amp;&nbsp;xs]
</span><br/>
<span class="covered" title="17 out of 17 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(some&nbsp;#(and&nbsp;(map?&nbsp;%)&nbsp;(not&nbsp;(record?&nbsp;%)))&nbsp;xs)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;merge-with&nbsp;m&nbsp;xs)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(last&nbsp;xs)))]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce&nbsp;m&nbsp;maps)))
</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;make-target-filter
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&quot;Construct&nbsp;a&nbsp;filter&nbsp;which,&nbsp;when&nbsp;applied&nbsp;to&nbsp;a&nbsp;list&nbsp;of&nbsp;maps,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;pass&nbsp;those&nbsp;which&nbsp;match&nbsp;these&nbsp;`targets`,&nbsp;where&nbsp;each&nbsp;target
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;a&nbsp;tuple&nbsp;[key&nbsp;value].&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;this&nbsp;would&nbsp;probably&nbsp;be&nbsp;more&nbsp;elegant&nbsp;as&nbsp;a&nbsp;macro
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;[targets]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;(eval
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;fn
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(vector&nbsp;&#x27;m)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;and
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(list
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;=
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;(first&nbsp;%)&nbsp;&#x27;m)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nth&nbsp;%&nbsp;1))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;targets)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
036&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
037&nbsp;&nbsp;(defn&nbsp;value-or-default
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;value&nbsp;of&nbsp;this&nbsp;key&nbsp;`k`&nbsp;in&nbsp;this&nbsp;map&nbsp;`m`,&nbsp;or&nbsp;this&nbsp;`dflt`&nbsp;value&nbsp;if
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;there&nbsp;is&nbsp;none.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;[m&nbsp;k&nbsp;dflt]
</span><br/>
<span class="not-covered" title="0 out of 13 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(or&nbsp;(when&nbsp;(map?&nbsp;m)&nbsp;(m&nbsp;k))&nbsp;dflt))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;;;&nbsp;(value-or-default&nbsp;{:x&nbsp;0&nbsp;:y&nbsp;0&nbsp;:altitude&nbsp;7}&nbsp;:altitude&nbsp;8)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;;;&nbsp;(value-or-default&nbsp;{:x&nbsp;0&nbsp;:y&nbsp;0&nbsp;:altitude&nbsp;7}&nbsp;:alt&nbsp;8)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;;;&nbsp;(value-or-default&nbsp;nil&nbsp;:altitude&nbsp;8)
</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;(defn&nbsp;truthy?&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&quot;Returns&nbsp;`true`&nbsp;unless&nbsp;`val`&nbsp;is&nbsp;`nil`,&nbsp;`false`&nbsp;or&nbsp;an&nbsp;empty&nbsp;sequence.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Otherwise&nbsp;always&nbsp;&#x27;false&#x27;;&nbsp;never&nbsp;any&nbsp;other&nbsp;value.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;[val]
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(or&nbsp;val&nbsp;false)&nbsp;true))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
052&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
053&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
054&nbsp;&nbsp;(defn&nbsp;inc-or-one
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&quot;If&nbsp;this&nbsp;`val`&nbsp;is&nbsp;a&nbsp;number,&nbsp;return&nbsp;that&nbsp;number&nbsp;incremented&nbsp;by&nbsp;one;&nbsp;otherwise,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;1.&nbsp;TODO:&nbsp;should&nbsp;probably&nbsp;be&nbsp;in&nbsp;`utils`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;[val]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(number?&nbsp;val)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(inc&nbsp;val)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,485 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/world/heightmap.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.world.heightmap
</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;the&nbsp;tessellated&nbsp;multi-layer&nbsp;heightmap.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.math.numeric-tower&nbsp;:refer&nbsp;[expt&nbsp;sqrt]]
</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;&nbsp;&nbsp;[mw-engine.core&nbsp;:refer&nbsp;[]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-engine.heightmap&nbsp;:refer&nbsp;[apply-heightmap]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-engine.utils&nbsp;:refer&nbsp;[get-cell&nbsp;in-bounds?&nbsp;map-world]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[value-or-default]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
008&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;&nbsp;It&#x27;s&nbsp;not&nbsp;at&nbsp;all&nbsp;clear&nbsp;to&nbsp;me&nbsp;yet&nbsp;what&nbsp;the&nbsp;workflow&nbsp;for&nbsp;getting&nbsp;a&nbsp;MicroWorld
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;&nbsp;map&nbsp;into&nbsp;The&nbsp;Great&nbsp;Game,&nbsp;and&nbsp;whether&nbsp;it&nbsp;passes&nbsp;through&nbsp;Walkmap&nbsp;to&nbsp;get&nbsp;here.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;&nbsp;This&nbsp;file&nbsp;as&nbsp;currently&nbsp;written&nbsp;assumes&nbsp;it&nbsp;doesn&#x27;t.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
012&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;&nbsp;It&#x27;s&nbsp;utterly&nbsp;impossible&nbsp;to&nbsp;hold&nbsp;a&nbsp;whole&nbsp;continent&nbsp;at&nbsp;one&nbsp;metre&nbsp;scale&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;&nbsp;memory&nbsp;at&nbsp;one&nbsp;time.&nbsp;So&nbsp;we&nbsp;have&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;regenerate&nbsp;high&nbsp;resolution
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;&nbsp;surfaces&nbsp;from&nbsp;much&nbsp;lower&nbsp;resolution&nbsp;heightmaps.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;&nbsp;Thus&nbsp;to&nbsp;reproduce&nbsp;a&nbsp;segment&nbsp;of&nbsp;surface&nbsp;at&nbsp;a&nbsp;particular&nbsp;level&nbsp;of&nbsp;detail,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;&nbsp;we:
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;&nbsp;1.&nbsp;load&nbsp;the&nbsp;base&nbsp;heightmap&nbsp;into&nbsp;a&nbsp;grid&nbsp;(see
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;`mw-engine.heightmap&#x2F;apply-heightmap`);
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;&nbsp;2.&nbsp;scale&nbsp;the&nbsp;base&nbsp;hightmap&nbsp;to&nbsp;kilometre&nbsp;scale&nbsp;(see&nbsp;`scale-grid`);
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;&nbsp;3.&nbsp;exerpt&nbsp;the&nbsp;portion&nbsp;of&nbsp;that&nbsp;that&nbsp;we&nbsp;want&nbsp;to&nbsp;reproduce&nbsp;(see&nbsp;`exerpt-grid`);
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;&nbsp;4.&nbsp;interpolate&nbsp;that&nbsp;grid&nbsp;to&nbsp;get&nbsp;the&nbsp;resolution&nbsp;we&nbsp;require&nbsp;(see
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;`interpolate-grid`);
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;&nbsp;5.&nbsp;create&nbsp;an&nbsp;appropriate&nbsp;purturbation&nbsp;grid&nbsp;from&nbsp;the&nbsp;noise&nbsp;map(s)&nbsp;for&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;same&nbsp;coordinates&nbsp;to&nbsp;break&nbsp;up&nbsp;the&nbsp;smooth&nbsp;interpolation;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;&nbsp;6.&nbsp;sum&nbsp;the&nbsp;altitudes&nbsp;of&nbsp;the&nbsp;two&nbsp;grids.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;&nbsp;In&nbsp;production&nbsp;this&nbsp;will&nbsp;have&nbsp;to&nbsp;be&nbsp;done&nbsp;**very**&nbsp;fast!
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
030&nbsp;&nbsp;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
031&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*base-map*&nbsp;&quot;resources&#x2F;maps&#x2F;heightmap.png&quot;)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
032&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*noise-map*&nbsp;&quot;resources&#x2F;maps&#x2F;noise.png&quot;)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(defn&nbsp;scale-grid
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&quot;multiply&nbsp;all&nbsp;`:x`&nbsp;and&nbsp;`:y`&nbsp;values&nbsp;in&nbsp;this&nbsp;`grid`&nbsp;by&nbsp;this&nbsp;`n`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;[grid&nbsp;n]
</span><br/>
<span class="not-covered" title="0 out of 19 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;(map-world&nbsp;grid&nbsp;(fn&nbsp;[w&nbsp;c&nbsp;x]&nbsp;(assoc&nbsp;c&nbsp;:x&nbsp;(*&nbsp;(:x&nbsp;c)&nbsp;n)&nbsp;:y&nbsp;(*&nbsp;(:y&nbsp;c)&nbsp;n)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
038&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
039&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
040&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;;;&nbsp;Each&nbsp;of&nbsp;the&nbsp;east-west&nbsp;curve&nbsp;and&nbsp;the&nbsp;north-south&nbsp;curve&nbsp;are&nbsp;of&nbsp;course&nbsp;two
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;;;&nbsp;dimensional&nbsp;curves;&nbsp;the&nbsp;east-west&nbsp;curve&nbsp;is&nbsp;in&nbsp;the&nbsp;:x&#x2F;:z&nbsp;plane&nbsp;and&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;;;&nbsp;north-south&nbsp;curve&nbsp;is&nbsp;in&nbsp;the&nbsp;:y&#x2F;:z&nbsp;plane&nbsp;(except,&nbsp;perhaps&nbsp;unwisely,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;;;&nbsp;we&#x27;ve&nbsp;been&nbsp;using&nbsp;:altitude&nbsp;to&nbsp;label&nbsp;the&nbsp;:z&nbsp;plane).&nbsp;We&nbsp;have&nbsp;a&nbsp;library
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;;;&nbsp;function&nbsp;`walkmap.edge&#x2F;intersection2d`,&nbsp;but&nbsp;as&nbsp;currently&nbsp;written&nbsp;it
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;;;&nbsp;can&nbsp;only&nbsp;find&nbsp;intersections&nbsp;in&nbsp;:x&#x2F;:y&nbsp;plane.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;rewrite&nbsp;the&nbsp;function&nbsp;so&nbsp;that&nbsp;it&nbsp;can&nbsp;use&nbsp;arbitrary&nbsp;coordinates.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;;;&nbsp;AFTER&nbsp;TRYING:&nbsp;OK,&nbsp;there&nbsp;are&nbsp;too&nbsp;many&nbsp;assumptions&nbsp;about&nbsp;the&nbsp;way&nbsp;that
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;;;&nbsp;function&nbsp;is&nbsp;written&nbsp;to&nbsp;allow&nbsp;for&nbsp;easy&nbsp;rotation.&nbsp;TODO:&nbsp;think!
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
051&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
052&nbsp;&nbsp;(defn&nbsp;interpolate-altitude
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;altitude&nbsp;of&nbsp;the&nbsp;point&nbsp;at&nbsp;`x-offset`,&nbsp;`y-offset`&nbsp;within&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;`cell`&nbsp;having&nbsp;this&nbsp;`src-width`,&nbsp;taken&nbsp;from&nbsp;this&nbsp;`grid`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;[cell&nbsp;grid&nbsp;src-width&nbsp;x-offset&nbsp;y-offset&nbsp;]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[c-alt&nbsp;(:altitude&nbsp;cell)
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n-alt&nbsp;(or&nbsp;(:altitude&nbsp;(get-cell&nbsp;grid&nbsp;(:x&nbsp;cell)&nbsp;(dec&nbsp;(:y&nbsp;cell))))&nbsp;c-alt)
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w-alt&nbsp;(or&nbsp;(:altitude&nbsp;(get-cell&nbsp;grid&nbsp;(inc&nbsp;(:x&nbsp;cell))&nbsp;(:y&nbsp;cell)))&nbsp;c-alt)
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-alt&nbsp;(or&nbsp;(:altitude&nbsp;(get-cell&nbsp;grid&nbsp;(:x&nbsp;cell)&nbsp;(inc&nbsp;(:y&nbsp;cell))))&nbsp;c-alt)
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e-alt&nbsp;(or&nbsp;(:altitude&nbsp;(get-cell&nbsp;grid&nbsp;(dec&nbsp;(:x&nbsp;cell))&nbsp;(:y&nbsp;cell)))&nbsp;c-alt)]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;construct&nbsp;two&nbsp;curves&nbsp;(arcs&nbsp;of&nbsp;circles&nbsp;good&nbsp;enough&nbsp;for&nbsp;now)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;n-alt...c-alt...s-alt&nbsp;and&nbsp;e-alt...c-alt...w-alt;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;then&nbsp;interpolate&nbsp;x-offset&nbsp;along&nbsp;e-alt...c-alt...w-alt&nbsp;and&nbsp;y-offset
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;along&nbsp;n-alt...c-alt...s-alt;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;then&nbsp;return&nbsp;the&nbsp;average&nbsp;of&nbsp;the&nbsp;two
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
066&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
068&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
069&nbsp;&nbsp;(defn&nbsp;interpolate-cell
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&quot;Construct&nbsp;a&nbsp;grid&nbsp;(array&nbsp;of&nbsp;arrays)&nbsp;of&nbsp;cells&nbsp;each&nbsp;of&nbsp;width&nbsp;`target-width`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;this&nbsp;`cell`,&nbsp;of&nbsp;width&nbsp;`src-width`,&nbsp;taken&nbsp;from&nbsp;this&nbsp;`grid`&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;[cell&nbsp;grid&nbsp;src-width&nbsp;target-width]
</span><br/>
<span class="not-covered" title="0 out of 12 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[offsets&nbsp;(map&nbsp;#(*&nbsp;target-width&nbsp;%)&nbsp;(range&nbsp;(&#x2F;&nbsp;src-width&nbsp;target-width)))]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(into
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[r]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(into
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[c]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assoc&nbsp;cell
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:x&nbsp;(+&nbsp;(:x&nbsp;cell)&nbsp;c)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:y&nbsp;(+&nbsp;(:y&nbsp;cell)&nbsp;r)
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:altitude&nbsp;(interpolate-altitude&nbsp;cell&nbsp;grid&nbsp;src-width&nbsp;c&nbsp;r)))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offsets)))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offsets))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
088&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
089&nbsp;&nbsp;(defn&nbsp;interpolate-grid
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;grid&nbsp;interpolated&nbsp;from&nbsp;this&nbsp;`grid`&nbsp;of&nbsp;rows,&nbsp;cols&nbsp;given&nbsp;scaling
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;this&nbsp;`src-width`&nbsp;to&nbsp;this&nbsp;`target-width`&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;[grid&nbsp;src-width&nbsp;target-width]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;concat
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(into
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[row]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reduce
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[g1&nbsp;g2]
</span><br/>
<span class="not-covered" title="0 out of 15 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(into&nbsp;[]&nbsp;(map&nbsp;#(into&nbsp;[]&nbsp;(concat&nbsp;%1&nbsp;%2))&nbsp;g1&nbsp;g2)))
</span><br/>
<span class="not-covered" title="0 out of 13 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(into&nbsp;[]&nbsp;(map&nbsp;#(interpolate-cell&nbsp;%&nbsp;grid&nbsp;src-width&nbsp;target-width)&nbsp;row))))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;grid))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
104&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
105&nbsp;&nbsp;(defn&nbsp;excerpt-grid
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;that&nbsp;section&nbsp;of&nbsp;this&nbsp;`grid`&nbsp;where&nbsp;the&nbsp;`:x`&nbsp;co-ordinate&nbsp;of&nbsp;each&nbsp;cell
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;greater&nbsp;than&nbsp;or&nbsp;equal&nbsp;to&nbsp;this&nbsp;`x-offset`,&nbsp;the&nbsp;`:y`&nbsp;co-ordinate&nbsp;is&nbsp;greater
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;than&nbsp;or&nbsp;equal&nbsp;to&nbsp;this&nbsp;`y-offset`,&nbsp;whose&nbsp;width&nbsp;is&nbsp;not&nbsp;greater&nbsp;than&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;`width`,&nbsp;and&nbsp;whose&nbsp;height&nbsp;is&nbsp;not&nbsp;greater&nbsp;than&nbsp;this&nbsp;`height`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;[grid&nbsp;x-offset&nbsp;y-offset&nbsp;width&nbsp;height]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;(into
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nil?
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[row]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&gt;=&nbsp;(:y&nbsp;(first&nbsp;row))&nbsp;y-offset)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&lt;&nbsp;(:y&nbsp;(first&nbsp;row))&nbsp;(+&nbsp;y-offset&nbsp;height)))
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(into
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nil?
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[cell]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
129&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;(&gt;=&nbsp;(:x&nbsp;cell)&nbsp;x-offset)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
130&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;(&lt;&nbsp;(:x&nbsp;cell)&nbsp;(+&nbsp;x-offset&nbsp;width)))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cell))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;row)))))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;grid))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
134&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
135&nbsp;&nbsp;(defn&nbsp;get-surface
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return,&nbsp;as&nbsp;a&nbsp;vector&nbsp;of&nbsp;vectors&nbsp;of&nbsp;cells&nbsp;represented&nbsp;as&nbsp;Clojure&nbsp;maps,&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;segment&nbsp;of&nbsp;surface&nbsp;from&nbsp;this&nbsp;`base-map`&nbsp;as&nbsp;modified&nbsp;by&nbsp;this
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;`noise-map`&nbsp;at&nbsp;this&nbsp;`cell-size`&nbsp;starting&nbsp;at&nbsp;this&nbsp;`x-offset`&nbsp;and&nbsp;`y-offset`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;having&nbsp;this&nbsp;`width`&nbsp;and&nbsp;`height`.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
140&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`base-map`&nbsp;and&nbsp;`noise-map`&nbsp;are&nbsp;not&nbsp;supplied,&nbsp;the&nbsp;bindings&nbsp;of&nbsp;`*base-map*`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
142&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;`*noise-map*`&nbsp;will&nbsp;be&nbsp;used,&nbsp;respectively.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
143&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;`base-map`&nbsp;and&nbsp;`noise-map`&nbsp;may&nbsp;be&nbsp;passed&nbsp;either&nbsp;as&nbsp;strings,&nbsp;assumed&nbsp;to&nbsp;be
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
145&nbsp;&nbsp;&nbsp;&nbsp;file&nbsp;paths&nbsp;of&nbsp;PNG&nbsp;files,&nbsp;or&nbsp;as&nbsp;MicroWorld&nbsp;style&nbsp;world&nbsp;arrays.&nbsp;It&nbsp;is&nbsp;assumed
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
146&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;one&nbsp;pixel&nbsp;in&nbsp;`base-map`&nbsp;represents&nbsp;one&nbsp;square&nbsp;kilometre&nbsp;in&nbsp;the&nbsp;game
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;world.&nbsp;It&nbsp;is&nbsp;assumed&nbsp;that&nbsp;`cell-size`,&nbsp;`x-offset`,&nbsp;`y-offset`,&nbsp;`width`&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;`height`&nbsp;are&nbsp;integer&nbsp;numbers&nbsp;of&nbsp;metres.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;([cell-size&nbsp;x-offset&nbsp;y-offset&nbsp;width&nbsp;height]
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(get-surface&nbsp;*base-map*&nbsp;*noise-map*&nbsp;cell-size&nbsp;x-offset&nbsp;y-offset&nbsp;width&nbsp;height))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
151&nbsp;&nbsp;&nbsp;&nbsp;([base-map&nbsp;noise-map&nbsp;cell-size&nbsp;x-offset&nbsp;y-offset&nbsp;width&nbsp;height]
</span><br/>
<span class="not-covered" title="0 out of 12 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[b&nbsp;(if&nbsp;(seq?&nbsp;base-map)&nbsp;base-map&nbsp;(scale-grid&nbsp;(apply-heightmap&nbsp;base-map)&nbsp;1000))
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;(if&nbsp;(seq?&nbsp;noise-map)&nbsp;noise-map&nbsp;(apply-heightmap&nbsp;noise-map))]
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(and&nbsp;(in-bounds?&nbsp;b&nbsp;x-offset&nbsp;y-offset)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(in-bounds?&nbsp;b&nbsp;(+&nbsp;x-offset&nbsp;width)&nbsp;(+&nbsp;y-offset&nbsp;height)))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b&nbsp;;;&nbsp;actually&nbsp;do&nbsp;stuff
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;&quot;Surface&nbsp;out&nbsp;of&nbsp;bounds&nbsp;for&nbsp;map.&quot;)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
159&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> cc/journeyman/the_great_game/world/location.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.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="23 out of 23 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>

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> cc/journeyman/the_great_game/world/mw.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.world.mw
</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;building&nbsp;a&nbsp;great&nbsp;game&nbsp;world&nbsp;from&nbsp;a&nbsp;MicroWorld&nbsp;world.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.math.numeric-tower&nbsp;:refer&nbsp;[expt&nbsp;sqrt]]
</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;&nbsp;&nbsp;[mw-engine.core&nbsp;:refer&nbsp;[]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-engine.world&nbsp;:refer&nbsp;[]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
006&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;&nbsp;It&#x27;s&nbsp;not&nbsp;at&nbsp;all&nbsp;clear&nbsp;to&nbsp;me&nbsp;yet&nbsp;what&nbsp;the&nbsp;workflow&nbsp;for&nbsp;getting&nbsp;a&nbsp;MicroWorld&nbsp;map&nbsp;into&nbsp;The&nbsp;Great&nbsp;Game,&nbsp;and&nbsp;whether&nbsp;it&nbsp;passes&nbsp;through&nbsp;Walkmap&nbsp;to&nbsp;get&nbsp;here.&nbsp;This&nbsp;file&nbsp;as&nbsp;currently&nbsp;written&nbsp;assumes&nbsp;it&nbsp;doesn&#x27;t.
</span><br/>
</body>
</html>

View file

@ -0,0 +1,173 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/world/routes.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.world.routes
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Conceptual&nbsp;(plan&nbsp;level)&nbsp;routes,&nbsp;represented&nbsp;as&nbsp;tuples&nbsp;of&nbsp;location&nbsp;ids.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[cc.journeyman.the-great-game.utils&nbsp;:refer&nbsp;[cyclic?]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
004&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
005&nbsp;&nbsp;(defn&nbsp;find-routes
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&quot;Find&nbsp;routes&nbsp;from&nbsp;among&nbsp;these&nbsp;`routes`&nbsp;from&nbsp;`from`;&nbsp;if&nbsp;`to`&nbsp;is&nbsp;supplied,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;`to`,&nbsp;by&nbsp;breadth-first&nbsp;search.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;([routes&nbsp;from]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[to]&nbsp;(cons&nbsp;from&nbsp;to))
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;empty?
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[route]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(=&nbsp;from&nbsp;%)
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(some&nbsp;#(=&nbsp;%&nbsp;from)&nbsp;route)&nbsp;route)))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;routes))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;([routes&nbsp;from&nbsp;to]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[steps&nbsp;(find-routes&nbsp;routes&nbsp;from)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found&nbsp;(filter
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[step]&nbsp;(if&nbsp;(some&nbsp;#(=&nbsp;to&nbsp;%)&nbsp;step)&nbsp;step))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;steps)]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(empty?&nbsp;found)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(find-routes&nbsp;routes&nbsp;from&nbsp;to&nbsp;steps)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;([routes&nbsp;from&nbsp;to&nbsp;steps]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(not&nbsp;(empty?&nbsp;steps))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[paths&nbsp;(remove
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cyclic?
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(mapcat
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&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;(fn&nbsp;[path]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
035&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;(map
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
036&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;(fn&nbsp;[x]&nbsp;(concat&nbsp;path&nbsp;(rest&nbsp;x)))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
037&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;(find-routes&nbsp;routes&nbsp;(last&nbsp;path))))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
038&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;steps))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found&nbsp;(filter
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(=&nbsp;(last&nbsp;%)&nbsp;to)&nbsp;paths)]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(empty?&nbsp;found)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(find-routes&nbsp;routes&nbsp;from&nbsp;to&nbsp;paths)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
046&nbsp;&nbsp;(defn&nbsp;find-route
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&quot;Find&nbsp;a&nbsp;single&nbsp;route&nbsp;from&nbsp;`from`&nbsp;to&nbsp;`to`&nbsp;in&nbsp;this&nbsp;`world-or-routes`,&nbsp;which
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;may&nbsp;be&nbsp;either&nbsp;a&nbsp;world&nbsp;as&nbsp;defined&nbsp;in&nbsp;[[the-great-game.world.world]]&nbsp;or&nbsp;else
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;sequence&nbsp;of&nbsp;tuples&nbsp;of&nbsp;keywords.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;[world-or-routes&nbsp;from&nbsp;to]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;(first
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(find-routes
</span><br/>
<span class="partial" title="7 out of 8 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(or&nbsp;(:routes&nbsp;world-or-routes)&nbsp;world-or-routes)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to)))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,125 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/world/run.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.world.run
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Run&nbsp;the&nbsp;whole&nbsp;simulation&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[environ.core&nbsp;:refer&nbsp;[env]]
</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;[taoensso.timbre&nbsp;:as&nbsp;timbre]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[taoensso.timbre.appenders.3rd-party.rotor&nbsp;:as&nbsp;rotor]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.gossip.gossip&nbsp;:as&nbsp;g]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.merchants.merchants&nbsp;:as&nbsp;m]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.merchants.markets&nbsp;:as&nbsp;k]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cc.journeyman.the-great-game.world.world&nbsp;:as&nbsp;w]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
010&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
011&nbsp;&nbsp;(defn&nbsp;init
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;([]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(init&nbsp;{}))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;([config]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(timbre&#x2F;merge-config!
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:appenders
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:rotor&nbsp;(rotor&#x2F;rotor-appender
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:path&nbsp;&quot;the-great-game.log&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:max-size&nbsp;(*&nbsp;512&nbsp;1024)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:backlog&nbsp;10})}
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:level&nbsp;(or
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:log-level&nbsp;config)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(env&nbsp;:dev)&nbsp;:debug)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:info)})))
</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;(defn&nbsp;run
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;pipeline&nbsp;to&nbsp;run&nbsp;the&nbsp;simulation&nbsp;each&nbsp;game&nbsp;day.&nbsp;Returns&nbsp;a&nbsp;world&nbsp;like
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;world,&nbsp;with&nbsp;all&nbsp;the&nbsp;various&nbsp;active&nbsp;elements&nbsp;updated.&nbsp;The&nbsp;optional
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;`date`&nbsp;argument,&nbsp;if&nbsp;supplied,&nbsp;is&nbsp;set&nbsp;as&nbsp;the&nbsp;`:date`&nbsp;of&nbsp;the&nbsp;returned&nbsp;world.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;([world]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;(g&#x2F;run
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(m&#x2F;run
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(k&#x2F;run
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(w&#x2F;run&nbsp;world)))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;([world&nbsp;date]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;(g&#x2F;run
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(m&#x2F;run
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(k&#x2F;run
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(w&#x2F;run&nbsp;world&nbsp;date))))))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,584 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/world/world.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;cc.journeyman.the-great-game.world.world
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Access&nbsp;to&nbsp;data&nbsp;about&nbsp;the&nbsp;world&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;The&nbsp;world&nbsp;has&nbsp;to&nbsp;work&nbsp;either&nbsp;as&nbsp;map&nbsp;or&nbsp;a&nbsp;database.&nbsp;Initially,&nbsp;and&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;;&nbsp;unit&nbsp;tests,&nbsp;I&#x27;ll&nbsp;use&nbsp;a&nbsp;map;&nbsp;later,&nbsp;there&nbsp;will&nbsp;be&nbsp;a&nbsp;database.&nbsp;But&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;;&nbsp;API&nbsp;needs&nbsp;to&nbsp;be&nbsp;agnostic,&nbsp;so&nbsp;that&nbsp;heirarchies&nbsp;which&nbsp;interact&nbsp;with
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;;&nbsp;`world`&nbsp;don&#x27;t&nbsp;have&nbsp;to&nbsp;know&nbsp;which&nbsp;they&#x27;ve&nbsp;got&nbsp;-&nbsp;as&nbsp;far&nbsp;as&nbsp;they&#x27;re&nbsp;concerned
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;;&nbsp;it&#x27;s&nbsp;just&nbsp;a&nbsp;handle.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
010&nbsp;&nbsp;(def&nbsp;default-world
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&quot;A&nbsp;basic&nbsp;world&nbsp;for&nbsp;testing&nbsp;concepts&quot;
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;{:date&nbsp;0&nbsp;;;&nbsp;the&nbsp;age&nbsp;of&nbsp;this&nbsp;world&nbsp;in&nbsp;game&nbsp;days
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cities
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:aberdeen
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:id&nbsp;:aberdeen
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:supplies
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;`supplies`&nbsp;is&nbsp;the&nbsp;quantity&nbsp;of&nbsp;each&nbsp;commodity&nbsp;added&nbsp;to&nbsp;the&nbsp;stock
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;each&nbsp;game&nbsp;day.&nbsp;If&nbsp;the&nbsp;price&nbsp;in&nbsp;the&nbsp;market&nbsp;is&nbsp;lower&nbsp;than&nbsp;1&nbsp;(the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;cost&nbsp;of&nbsp;production&nbsp;of&nbsp;a&nbsp;unit)&nbsp;no&nbsp;goods&nbsp;will&nbsp;be&nbsp;added.
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:fish&nbsp;10
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;5}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:demands
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;`stock`&nbsp;is&nbsp;the&nbsp;quantity&nbsp;of&nbsp;each&nbsp;commodity&nbsp;in&nbsp;the&nbsp;market&nbsp;at&nbsp;any
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;given&nbsp;time.&nbsp;It&nbsp;is&nbsp;adjusted&nbsp;for&nbsp;production&nbsp;and&nbsp;consumption&nbsp;at
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;the&nbsp;end&nbsp;of&nbsp;each&nbsp;game&nbsp;day.
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:iron&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cloth&nbsp;10
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;10}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:port&nbsp;true
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:prices
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;`prices`:&nbsp;the&nbsp;current&nbsp;price&nbsp;(both&nbsp;buying&nbsp;and&nbsp;selling,&nbsp;for&nbsp;simplicity)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;of&nbsp;each&nbsp;commodity&nbsp;in&nbsp;the&nbsp;market.&nbsp;Updated&nbsp;each&nbsp;game&nbsp;day&nbsp;based&nbsp;on&nbsp;current
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;stock.
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;1}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;`stock`&nbsp;is&nbsp;the&nbsp;quantity&nbsp;of&nbsp;each&nbsp;commodity&nbsp;in&nbsp;the&nbsp;market&nbsp;at&nbsp;any
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;given&nbsp;time.&nbsp;It&nbsp;is&nbsp;adjusted&nbsp;for&nbsp;production&nbsp;and&nbsp;consumption&nbsp;at
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;the&nbsp;end&nbsp;of&nbsp;each&nbsp;game&nbsp;day.
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;0}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;100}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:buckie
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:id&nbsp;:buckie
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:supplies
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:fish&nbsp;20}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:demands
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;3
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:port&nbsp;true
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:prices&nbsp;{:cloth&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;1}
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{:cloth&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;0}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;100}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:callander
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:id&nbsp;:callander
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:supplies&nbsp;{:leather&nbsp;20}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:demands
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;3
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1}
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:prices&nbsp;{:cloth&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;1}
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{:cloth&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;0}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;100}
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:dundee&nbsp;{:id&nbsp;:dundee}
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edinburgh&nbsp;{:id&nbsp;:dundee}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:falkirk
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:id&nbsp;:falkirk
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:supplies&nbsp;{:iron&nbsp;10}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:demands
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;3
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;10}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:port&nbsp;true
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:prices&nbsp;{:cloth&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;1}
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{:cloth&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;0}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;100}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:glasgow
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:id&nbsp;:glasgow
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:supplies&nbsp;{:whisky&nbsp;10}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:demands
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;3
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;5
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;10}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:port&nbsp;true
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:prices&nbsp;{:cloth&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;1
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;1}
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{:cloth&nbsp;0
</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;&nbsp;:fish&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;0
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;0}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cash&nbsp;100}}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:merchants
</span><br/>
<span class="covered" title="20 out of 20 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:archie&nbsp;{:id&nbsp;:archie
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:home&nbsp;:aberdeen&nbsp;:location&nbsp;:aberdeen&nbsp;:cash&nbsp;100&nbsp;:capacity&nbsp;10
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;{}
</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;:stock&nbsp;{}}
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:belinda&nbsp;{:id&nbsp;:belinda
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:home&nbsp;:buckie&nbsp;:location&nbsp;:buckie&nbsp;:cash&nbsp;100&nbsp;:capacity&nbsp;10
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;{}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{}}
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:callum&nbsp;{:id&nbsp;:callum
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:home&nbsp;:callander&nbsp;:location&nbsp;:calander&nbsp;:cash&nbsp;100&nbsp;:capacity&nbsp;10
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;{}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{}}
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:deirdre&nbsp;{:id&nbsp;:deidre
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:home&nbsp;:dundee&nbsp;:location&nbsp;:dundee&nbsp;:cash&nbsp;100&nbsp;:capacity&nbsp;10
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
146&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;{}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{}}
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:euan&nbsp;{:id&nbsp;:euan
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:home&nbsp;:edinbirgh&nbsp;:location&nbsp;:edinburgh&nbsp;:cash&nbsp;100&nbsp;:capacity&nbsp;10
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;{}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{}}
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fiona&nbsp;{:id&nbsp;:fiona
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:home&nbsp;:falkirk&nbsp;:location&nbsp;:falkirk&nbsp;:cash&nbsp;100&nbsp;:capacity&nbsp;10
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:known-prices&nbsp;{}
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:stock&nbsp;{}}}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:routes
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;all&nbsp;routes&nbsp;can&nbsp;be&nbsp;traversed&nbsp;in&nbsp;either&nbsp;direction&nbsp;and&nbsp;are&nbsp;assumed&nbsp;to
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;take&nbsp;the&nbsp;same&nbsp;amount&nbsp;of&nbsp;time.
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[:aberdeen&nbsp;:buckie]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
160&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:aberdeen&nbsp;:dundee]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:callander&nbsp;:glasgow]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:dundee&nbsp;:callander]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:dundee&nbsp;:edinburgh]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:dundee&nbsp;:falkirk]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:edinburgh&nbsp;:falkirk]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
166&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:falkirk&nbsp;:glasgow]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
167&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:commodities
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
168&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;cost&nbsp;of&nbsp;commodities&nbsp;is&nbsp;expressed&nbsp;in&nbsp;person&#x2F;days;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;weight&nbsp;in&nbsp;packhorse&nbsp;loads.&nbsp;Transport&nbsp;in&nbsp;this&nbsp;model
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;is&nbsp;all&nbsp;overland;&nbsp;you&nbsp;don&#x27;t&nbsp;take&nbsp;bulk&nbsp;cargoes&nbsp;overland
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;in&nbsp;this&nbsp;period,&nbsp;it&#x27;s&nbsp;too&nbsp;expensive.
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:cloth&nbsp;{:id&nbsp;:cloth&nbsp;:cost&nbsp;1&nbsp;:weight&nbsp;0.25}
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:fish&nbsp;{:id&nbsp;:fish&nbsp;:cost&nbsp;1&nbsp;:weight&nbsp;1}
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leather&nbsp;{:id&nbsp;:leather&nbsp;:cost&nbsp;1&nbsp;:weight&nbsp;0.5}
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:whisky&nbsp;{:id&nbsp;:whisky&nbsp;:cost&nbsp;1&nbsp;:weight&nbsp;0.1}
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
176&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:iron&nbsp;{:id&nbsp;:iron&nbsp;:cost&nbsp;1&nbsp;:weight&nbsp;10}}})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
177&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
178&nbsp;&nbsp;(defn&nbsp;actual-price
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
179&nbsp;&nbsp;&nbsp;&nbsp;&quot;Find&nbsp;the&nbsp;actual&nbsp;current&nbsp;price&nbsp;of&nbsp;this&nbsp;`commodity`&nbsp;in&nbsp;this&nbsp;`city`&nbsp;given
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
180&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;`world`.&nbsp;**NOTE**&nbsp;that&nbsp;merchants&nbsp;can&nbsp;only&nbsp;know&nbsp;the&nbsp;actual&nbsp;prices&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
181&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;city&nbsp;in&nbsp;which&nbsp;they&nbsp;are&nbsp;currently&nbsp;located.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
182&nbsp;&nbsp;&nbsp;&nbsp;[world&nbsp;commodity&nbsp;city]
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
183&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;world&nbsp;:cities&nbsp;city&nbsp;:prices&nbsp;commodity))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
184&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
185&nbsp;&nbsp;(defn&nbsp;run
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
186&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;a&nbsp;world&nbsp;like&nbsp;this&nbsp;`world`&nbsp;with&nbsp;only&nbsp;the&nbsp;`:date`&nbsp;to&nbsp;this&nbsp;`date`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
187&nbsp;&nbsp;&nbsp;&nbsp;(or&nbsp;id&nbsp;`date`&nbsp;not&nbsp;supplied,&nbsp;the&nbsp;current&nbsp;value&nbsp;incremented&nbsp;by&nbsp;one).&nbsp;For
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
188&nbsp;&nbsp;&nbsp;&nbsp;running&nbsp;other&nbsp;aspects&nbsp;of&nbsp;the&nbsp;simulation,&nbsp;see&nbsp;[[the-great-game.world.run]].&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
189&nbsp;&nbsp;&nbsp;&nbsp;([world]
</span><br/>
<span class="not-covered" title="0 out of 12 forms covered">
190&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(run&nbsp;world&nbsp;(inc&nbsp;(or&nbsp;(:date&nbsp;world)&nbsp;0))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
191&nbsp;&nbsp;&nbsp;&nbsp;([world&nbsp;date]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
192&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assoc&nbsp;world&nbsp;:date&nbsp;date)))
</span><br/>
</body>
</html>

View file

@ -15,44 +15,113 @@
<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/gossip/gossip.clj.html">the-great-game.gossip.gossip</a></td><td class="with-bar"><div class="covered"
<td><a href="cc/journeyman/the_great_game/agent/agent.clj.html">cc.journeyman.the-great-game.agent.agent</a></td><td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 3 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 3 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">45</td><td class="with-number">5</td><td class="with-number">3</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/buildings/module.clj.html">cc.journeyman.the-great-game.buildings.module</a></td><td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 2 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 2 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">81</td><td class="with-number">6</td><td class="with-number">2</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/buildings/rectangular.clj.html">cc.journeyman.the-great-game.buildings.rectangular</a></td><td class="with-bar"><div class="covered"
style="width:74.64788732394366%;
float:left;"> 106 </div><div class="not-covered"
style="width:25.35211267605634%;
float:left;"> 36 </div></td>
<td class="with-number">74.65 %</td>
<td class="with-bar"><div class="covered"
style="width:77.41935483870968%;
float:left;"> 24 </div><div class="partial"
style="width:3.225806451612903%;
float:left;"> 1 </div><div class="not-covered"
style="width:19.35483870967742%;
float:left;"> 6 </div></td>
<td class="with-number">80.65 %</td>
<td class="with-number">150</td><td class="with-number">25</td><td class="with-number">31</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/gossip/gossip.clj.html">cc.journeyman.the-great-game.gossip.gossip</a></td><td class="with-bar"><div class="covered"
style="width:4.62962962962963%;
float:left;"> 5 </div><div class="not-covered"
style="width:95.37037037037037%;
float:left;"> 103 </div></td>
<td class="with-number">4.63 %</td>
<td class="with-bar"><div class="covered"
style="width:12.820512820512821%;
style="width:12.5%;
float:left;"> 5 </div><div class="not-covered"
style="width:87.17948717948718%;
float:left;"> 34 </div></td>
<td class="with-number">12.82 %</td>
<td class="with-number">66</td><td class="with-number">5</td><td class="with-number">39</td>
style="width:87.5%;
float:left;"> 35 </div></td>
<td class="with-number">12.50 %</td>
<td class="with-number">73</td><td class="with-number">7</td><td class="with-number">40</td>
</tr>
<tr>
<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:92.80155642023347%;
float:left;"> 477 </div><div class="not-covered"
style="width:7.198443579766537%;
float:left;"> 37 </div></td>
<td class="with-number">92.80 %</td>
<td><a href="cc/journeyman/the_great_game/gossip/news_items.clj.html">cc.journeyman.the-great-game.gossip.news-items</a></td><td class="with-bar"><div class="covered"
style="width:77.15582450832072%;
float:left;"> 510 </div><div class="not-covered"
style="width:22.844175491679273%;
float:left;"> 151 </div></td>
<td class="with-number">77.16 %</td>
<td class="with-bar"><div class="covered"
style="width:88.07339449541284%;
float:left;"> 96 </div><div class="partial"
style="width:7.339449541284404%;
style="width:72.66187050359713%;
float:left;"> 101 </div><div class="partial"
style="width:5.755395683453237%;
float:left;"> 8 </div><div class="not-covered"
style="width:4.587155963302752%;
float:left;"> 5 </div></td>
<td class="with-number">95.41 %</td>
<td class="with-number">256</td><td class="with-number">31</td><td class="with-number">109</td>
style="width:21.58273381294964%;
float:left;"> 30 </div></td>
<td class="with-number">78.42 %</td>
<td class="with-number">345</td><td class="with-number">41</td><td class="with-number">139</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.46464646464646%;
float:left;"> 191 </div><div class="not-covered"
style="width:3.5353535353535355%;
<td><a href="cc/journeyman/the_great_game/holdings/holding.clj.html">cc.journeyman.the-great-game.holdings.holding</a></td><td class="with-bar"><div class="covered"
style="width:14.285714285714286%;
float:left;"> 3 </div><div class="not-covered"
style="width:85.71428571428571%;
float:left;"> 18 </div></td>
<td class="with-number">14.29 %</td>
<td class="with-bar"><div class="covered"
style="width:42.857142857142854%;
float:left;"> 3 </div><div class="not-covered"
style="width:57.142857142857146%;
float:left;"> 4 </div></td>
<td class="with-number">42.86 %</td>
<td class="with-number">46</td><td class="with-number">3</td><td class="with-number">7</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/location/location.clj.html">cc.journeyman.the-great-game.location.location</a></td><td class="with-bar"><div class="covered"
style="width:15.384615384615385%;
float:left;"> 4 </div><div class="not-covered"
style="width:84.61538461538461%;
float:left;"> 22 </div></td>
<td class="with-number">15.38 %</td>
<td class="with-bar"><div class="covered"
style="width:28.571428571428573%;
float:left;"> 4 </div><div class="not-covered"
style="width:71.42857142857143%;
float:left;"> 10 </div></td>
<td class="with-number">28.57 %</td>
<td class="with-number">45</td><td class="with-number">7</td><td class="with-number">14</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/merchants/markets.clj.html">cc.journeyman.the-great-game.merchants.markets</a></td><td class="with-bar"><div class="covered"
style="width:96.48241206030151%;
float:left;"> 192 </div><div class="not-covered"
style="width:3.5175879396984926%;
float:left;"> 7 </div></td>
<td class="with-number">96.46 %</td>
<td class="with-number">96.48 %</td>
<td class="with-bar"><div class="covered"
style="width:93.18181818181819%;
float:left;"> 41 </div><div class="partial"
@ -64,7 +133,7 @@
<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"
<td><a href="cc/journeyman/the_great_game/merchants/merchant_utils.clj.html">cc.journeyman.the-great-game.merchants.merchant-utils</a></td><td class="with-bar"><div class="covered"
style="width:65.4485049833887%;
float:left;"> 197 </div><div class="not-covered"
style="width:34.5514950166113%;
@ -81,12 +150,12 @@
<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"
style="width:2.816901408450704%;
<td><a href="cc/journeyman/the_great_game/merchants/merchants.clj.html">cc.journeyman.the-great-game.merchants.merchants</a></td><td class="with-bar"><div class="covered"
style="width:2.73972602739726%;
float:left;"> 2 </div><div class="not-covered"
style="width:97.1830985915493%;
float:left;"> 69 </div></td>
<td class="with-number">2.82 %</td>
style="width:97.26027397260275%;
float:left;"> 71 </div></td>
<td class="with-number">2.74 %</td>
<td class="with-bar"><div class="covered"
style="width:12.5%;
float:left;"> 2 </div><div class="not-covered"
@ -96,7 +165,7 @@
<td class="with-number">28</td><td class="with-number">3</td><td class="with-number">16</td>
</tr>
<tr>
<td><a href="the_great_game/merchants/planning.clj.html">the-great-game.merchants.planning</a></td><td class="with-bar"><div class="covered"
<td><a href="cc/journeyman/the_great_game/merchants/planning.clj.html">cc.journeyman.the-great-game.merchants.planning</a></td><td class="with-bar"><div class="covered"
style="width:89.27335640138408%;
float:left;"> 258 </div><div class="not-covered"
style="width:10.726643598615917%;
@ -113,12 +182,12 @@
<td class="with-number">159</td><td class="with-number">11</td><td class="with-number">85</td>
</tr>
<tr>
<td><a href="the_great_game/merchants/strategies/simple.clj.html">the-great-game.merchants.strategies.simple</a></td><td class="with-bar"><div class="covered"
style="width:0.8264462809917356%;
<td><a href="cc/journeyman/the_great_game/merchants/strategies/simple.clj.html">cc.journeyman.the-great-game.merchants.strategies.simple</a></td><td class="with-bar"><div class="covered"
style="width:0.8156606851549756%;
float:left;"> 5 </div><div class="not-covered"
style="width:99.17355371900827%;
float:left;"> 600 </div></td>
<td class="with-number">0.83 %</td>
style="width:99.18433931484502%;
float:left;"> 608 </div></td>
<td class="with-number">0.82 %</td>
<td class="with-bar"><div class="covered"
style="width:4.032258064516129%;
float:left;"> 5 </div><div class="not-covered"
@ -128,7 +197,7 @@
<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/objects/container.clj.html">the-great-game.objects.container</a></td><td class="with-bar"><div class="covered"
<td><a href="cc/journeyman/the_great_game/objects/container.clj.html">cc.journeyman.the-great-game.objects.container</a></td><td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 2 </div></td>
<td class="with-number">100.00 %</td>
@ -139,48 +208,86 @@
<td class="with-number">11</td><td class="with-number">1</td><td class="with-number">2</td>
</tr>
<tr>
<td><a href="the_great_game/objects/game_object.clj.html">the-great-game.objects.game-object</a></td><td class="with-bar"><div class="covered"
style="width:60.0%;
<td><a href="cc/journeyman/the_great_game/objects/game_object.clj.html">cc.journeyman.the-great-game.objects.game-object</a></td><td class="with-bar"><div class="covered"
style="width:50.0%;
float:left;"> 3 </div><div class="not-covered"
style="width:40.0%;
float:left;"> 2 </div></td>
<td class="with-number">60.00 %</td>
style="width:50.0%;
float:left;"> 3 </div></td>
<td class="with-number">50.00 %</td>
<td class="with-bar"><div class="covered"
style="width:60.0%;
style="width:50.0%;
float:left;"> 3 </div><div class="not-covered"
style="width:40.0%;
float:left;"> 2 </div></td>
<td class="with-number">60.00 %</td>
<td class="with-number">19</td><td class="with-number">2</td><td class="with-number">5</td>
style="width:50.0%;
float:left;"> 3 </div></td>
<td class="with-number">50.00 %</td>
<td class="with-number">21</td><td class="with-number">2</td><td class="with-number">6</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:99.5850622406639%;
float:left;"> 240 </div><div class="not-covered"
style="width:0.4149377593360996%;
float:left;"> 1 </div></td>
<td class="with-number">99.59 %</td>
<td><a href="cc/journeyman/the_great_game/playroom.clj.html">cc.journeyman.the-great-game.playroom</a></td><td class="with-bar"><div class="covered"
style="width:56.92307692307692%;
float:left;"> 222 </div><div class="not-covered"
style="width:43.07692307692308%;
float:left;"> 168 </div></td>
<td class="with-number">56.92 %</td>
<td class="with-bar"><div class="covered"
style="width:98.33333333333333%;
float:left;"> 59 </div><div class="partial"
style="width:23.529411764705884%;
float:left;"> 4 </div><div class="partial"
style="width:17.647058823529413%;
float:left;"> 3 </div><div class="not-covered"
style="width:58.8235294117647%;
float:left;"> 10 </div></td>
<td class="with-number">41.18 %</td>
<td class="with-number">72</td><td class="with-number">12</td><td class="with-number">17</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/time.clj.html">cc.journeyman.the-great-game.time</a></td><td class="with-bar"><div class="covered"
style="width:97.9253112033195%;
float:left;"> 236 </div><div class="not-covered"
style="width:2.074688796680498%;
float:left;"> 5 </div></td>
<td class="with-number">97.93 %</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">100.00 %</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%;
float:left;"> 69 </div></td>
<td class="with-number">100.00 %</td>
<td><a href="cc/journeyman/the_great_game/utils.clj.html">cc.journeyman.the-great-game.utils</a></td><td class="with-bar"><div class="covered"
style="width:85.4368932038835%;
float:left;"> 88 </div><div class="not-covered"
style="width:14.563106796116505%;
float:left;"> 15 </div></td>
<td class="with-number">85.44 %</td>
<td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 19 </div></td>
<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>
style="width:92.5925925925926%;
float:left;"> 25 </div><div class="not-covered"
style="width:7.407407407407407%;
float:left;"> 2 </div></td>
<td class="with-number">92.59 %</td>
<td class="with-number">61</td><td class="with-number">8</td><td class="with-number">27</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"
<td><a href="cc/journeyman/the_great_game/world/heightmap.clj.html">cc.journeyman.the-great-game.world.heightmap</a></td><td class="with-bar"><div class="covered"
style="width:3.5947712418300655%;
float:left;"> 11 </div><div class="not-covered"
style="width:96.40522875816994%;
float:left;"> 295 </div></td>
<td class="with-number">3.59 %</td>
<td class="with-bar"><div class="covered"
style="width:12.67605633802817%;
float:left;"> 9 </div><div class="not-covered"
style="width:87.32394366197182%;
float:left;"> 62 </div></td>
<td class="with-number">12.68 %</td>
<td class="with-number">159</td><td class="with-number">16</td><td class="with-number">71</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/world/location.clj.html">cc.journeyman.the-great-game.world.location</a></td><td class="with-bar"><div class="covered"
style="width:87.95180722891567%;
float:left;"> 73 </div><div class="not-covered"
style="width:12.048192771084338%;
@ -197,7 +304,18 @@
<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"
<td><a href="cc/journeyman/the_great_game/world/mw.clj.html">cc.journeyman.the-great-game.world.mw</a></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-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">1</td><td class="with-number">1</td>
</tr>
<tr>
<td><a href="cc/journeyman/the_great_game/world/routes.clj.html">cc.journeyman.the-great-game.world.routes</a></td><td class="with-bar"><div class="covered"
style="width:99.19354838709677%;
float:left;"> 123 </div><div class="not-covered"
style="width:0.8064516129032258%;
@ -212,7 +330,7 @@
<td class="with-number">55</td><td class="with-number">2</td><td class="with-number">42</td>
</tr>
<tr>
<td><a href="the_great_game/world/run.clj.html">the-great-game.world.run</a></td><td class="with-bar"><div class="covered"
<td><a href="cc/journeyman/the_great_game/world/run.clj.html">cc.journeyman.the-great-game.world.run</a></td><td class="with-bar"><div class="covered"
style="width:5.0%;
float:left;"> 3 </div><div class="not-covered"
style="width:95.0%;
@ -227,7 +345,7 @@
<td class="with-number">39</td><td class="with-number">2</td><td class="with-number">20</td>
</tr>
<tr>
<td><a href="the_great_game/world/world.clj.html">the-great-game.world.world</a></td><td class="with-bar"><div class="covered"
<td><a href="cc/journeyman/the_great_game/world/world.clj.html">cc.journeyman.the-great-game.world.world</a></td><td class="with-bar"><div class="covered"
style="width:96.10983981693364%;
float:left;"> 420 </div><div class="not-covered"
style="width:3.8901601830663615%;
@ -243,9 +361,9 @@
</tr>
<tr><td>Totals:</td>
<td class="with-bar"></td>
<td class="with-number">66.55 %</td>
<td class="with-number">58.91 %</td>
<td class="with-bar"></td>
<td class="with-number">68.63 %</td>
<td class="with-number">61.63 %</td>
</tr>
</table>
</body>

File diff suppressed because one or more lines are too long

20
docs/codox/API_Spec.html Normal file

File diff suppressed because one or more lines are too long

29
docs/codox/Appraisal.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

36
docs/codox/Economy.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

17
docs/codox/On-dying.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

24
docs/codox/Roadmap.html Normal file

File diff suppressed because one or more lines are too long

41
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

Some files were not shown because too many files have changed in this diff Show more