Prepended all namespaces with 'cc.journeyman'; tests run, 4 don't pass.
This commit is contained in:
parent
37dbb767ac
commit
310896cc95
34 changed files with 107 additions and 81 deletions
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.agent.agent
|
||||
(ns cc.journeyman.the-great-game.agent.agent
|
||||
"Anything in the game world with agency"
|
||||
(:require [the-great-game.objects.game-object :refer [ProtoObject]]
|
||||
[the-great-game.objects.container :refer [ProtoContainer]]))
|
||||
|
|
@ -35,9 +35,10 @@
|
|||
"Returns a sequence of effects an actor intends, as a consequence of
|
||||
acting. The encoding of these is not yet defined."))
|
||||
|
||||
;; (defrecord Agent
|
||||
;; "A default agent."
|
||||
;; ProtoObject
|
||||
;; ProtoContainer
|
||||
;; ProtoAgent
|
||||
;; )
|
||||
(defrecord Agent
|
||||
;; "A default agent."
|
||||
[name home tribe]
|
||||
ProtoObject
|
||||
ProtoContainer
|
||||
ProtoAgent
|
||||
)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
(ns the-great-game.gossip.gossip
|
||||
(ns cc.journeyman.the-great-game.gossip.gossip
|
||||
"Interchange of news events between gossip agents"
|
||||
(:require [the-great-game.utils :refer [deep-merge]]
|
||||
[the-great-game.gossip.news-items :refer [learn-news-item]]))
|
||||
(:require [cc.journeyman.the-great-game.utils :refer [deep-merge]]
|
||||
[cc.journeyman.the-great-game.gossip.news-items :refer [learn-news-item]]))
|
||||
|
||||
;; Note that habitual travellers are all gossip agents; specifically, at this
|
||||
;; stage, that means merchants. When merchants are moved we also need to
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
(ns the-great-game.gossip.news-items
|
||||
(ns cc.journeyman.the-great-game.gossip.news-items
|
||||
"Categories of news events interesting to gossip agents"
|
||||
(:require [the-great-game.world.location :refer [distance-between]]
|
||||
[the-great-game.time :refer [game-time]]))
|
||||
(:require [cc.journeyman.the-great-game.world.location :refer [distance-between]]
|
||||
[cc.journeyman.the-great-game.time :refer [game-time]]))
|
||||
|
||||
;; The ideas here are based on the essay 'The spread of knowledge in a large
|
||||
;; game world', q.v.; they've advanced a little beyond that and will doubtless
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
(ns the-great-game.merchants.markets
|
||||
(ns cc.journeyman.the-great-game.merchants.markets
|
||||
"Adjusting quantities and prices in markets."
|
||||
(:require [taoensso.timbre :as l :refer [info error]]
|
||||
[the-great-game.utils :refer [deep-merge]]))
|
||||
[cc.journeyman.the-great-game.utils :refer [deep-merge]]))
|
||||
|
||||
(defn new-price
|
||||
"If `stock` is greater than the maximum of `supply` and `demand`, then
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.merchants.merchant-utils
|
||||
(ns cc.journeyman.the-great-game.merchants.merchant-utils
|
||||
"Useful functions for doing low-level things with merchants.")
|
||||
|
||||
(defn expected-price
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.merchants.merchants
|
||||
(ns cc.journeyman.the-great-game.merchants.merchants
|
||||
"Trade planning for merchants, primarily."
|
||||
(:require [taoensso.timbre :as l :refer [info error spy]]
|
||||
[the-great-game.utils :refer [deep-merge]]
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
(ns the-great-game.merchants.planning
|
||||
(ns cc.journeyman.the-great-game.merchants.planning
|
||||
"Trade planning for merchants, primarily. This follows a simple-minded
|
||||
generate-and-test strategy and currently generates plans for all possible
|
||||
routes from the current location. This may not scale. Also, routes do not
|
||||
currently have cost or risk associated with them."
|
||||
(:require [the-great-game.utils :refer [deep-merge make-target-filter]]
|
||||
[the-great-game.merchants.merchant-utils :refer :all]
|
||||
[the-great-game.world.routes :refer [find-route]]
|
||||
[the-great-game.world.world :refer [actual-price default-world]]))
|
||||
(:require [cc.journeyman.the-great-game.utils :refer [deep-merge make-target-filter]]
|
||||
[cc.journeyman.the-great-game.merchants.merchant-utils :refer [can-afford can-carry expected-price]]
|
||||
[cc.journeyman.the-great-game.world.routes :refer [find-route]]
|
||||
[cc.journeyman.the-great-game.world.world :refer [actual-price default-world]]))
|
||||
|
||||
(defn generate-trade-plans
|
||||
"Generate all possible trade plans for this `merchant` and this `commodity`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.merchants.strategies.simple
|
||||
(ns cc.journeyman.the-great-game.merchants.strategies.simple
|
||||
"Default trading strategy for merchants.
|
||||
|
||||
The simple strategy buys a single product in the local market if there is
|
||||
|
|
@ -7,12 +7,12 @@
|
|||
profitably, moves towards home with no cargo. If at home and no commodity
|
||||
can be traded profitably, does not move."
|
||||
(:require [taoensso.timbre :as l :refer [info error spy]]
|
||||
[the-great-game.utils :refer [deep-merge]]
|
||||
[the-great-game.gossip.gossip :refer [move-gossip]]
|
||||
[the-great-game.merchants.planning :refer :all]
|
||||
[the-great-game.merchants.merchant-utils :refer
|
||||
[cc.journeyman.the-great-game.utils :refer [deep-merge]]
|
||||
[cc.journeyman.the-great-game.gossip.gossip :refer [move-gossip]]
|
||||
[cc.journeyman.the-great-game.merchants.planning :refer [augment-plan plan-trade select-cargo]]
|
||||
[cc.journeyman.the-great-game.merchants.merchant-utils :refer
|
||||
[add-stock add-known-prices]]
|
||||
[the-great-game.world.routes :refer [find-route]]))
|
||||
[cc.journeyman.the-great-game.world.routes :refer [find-route]]))
|
||||
|
||||
(defn plan-and-buy
|
||||
"Return a world like this `world`, in which this `merchant` has planned
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
(ns the-great-game.objects.container
|
||||
(ns cc.journeyman.the-great-game.objects.container
|
||||
(:require
|
||||
[the-great-game.objects.game-object :refer :all]))
|
||||
[cc.journeyman.the-great-game.objects.game-object :refer :all]))
|
||||
|
||||
(defprotocol ProtoContainer
|
||||
(contents
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.objects.game-object
|
||||
(ns cc.journeyman.the-great-game.objects.game-object
|
||||
"Anything at all in the game world")
|
||||
|
||||
(defprotocol ProtoObject
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.time
|
||||
(ns cc.journeyman.the-great-game.time
|
||||
(:require [clojure.string :as s]))
|
||||
|
||||
(def game-start-time
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.utils)
|
||||
(ns cc.journeyman.the-great-game.utils)
|
||||
|
||||
(defn cyclic?
|
||||
"True if two or more elements of `route` are identical"
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
(ns the-great-game.world.heightmap
|
||||
(ns cc.journeyman.the-great-game.world.heightmap
|
||||
"Functions dealing with the tessellated multi-layer heightmap."
|
||||
(:require [clojure.math.numeric-tower :refer [expt sqrt]]
|
||||
[mw-engine.core :refer []]
|
||||
[mw-engine.heightmap :refer [apply-heightmap]]
|
||||
[mw-engine.utils :refer [get-cell in-bounds? map-world]]
|
||||
[the-great-game.utils :refer [value-or-default]]))
|
||||
[mw-engine.utils :refer [get-cell in-bounds? map-world scale-world]]
|
||||
[cc.journeyman.the-great-game.utils :refer [value-or-default]]))
|
||||
|
||||
;; It's not at all clear to me yet what the workflow for getting a MicroWorld
|
||||
;; map into The Great Game, and whether it passes through Walkmap to get here.
|
||||
|
|
@ -129,7 +129,8 @@
|
|||
(>= (:x cell) x-offset)
|
||||
(< (:x cell) (+ x-offset width)))
|
||||
cell))
|
||||
row)))))))))
|
||||
row)))))
|
||||
grid))))
|
||||
|
||||
(defn get-surface
|
||||
"Return, as a vector of vectors of cells represented as Clojure maps, a
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.world.location
|
||||
(ns cc.journeyman.the-great-game.world.location
|
||||
"Functions dealing with location in the world."
|
||||
(:require [clojure.math.numeric-tower :refer [expt sqrt]]))
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.world.mw
|
||||
(ns cc.journeyman.the-great-game.world.mw
|
||||
"Functions dealing with building a great game world from a MicroWorld world."
|
||||
(:require [clojure.math.numeric-tower :refer [expt sqrt]]
|
||||
[mw-engine.core :refer []]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
(ns the-great-game.world.routes
|
||||
(ns cc.journeyman.the-great-game.world.routes
|
||||
"Conceptual (plan level) routes, represented as tuples of location ids."
|
||||
(:require [the-great-game.utils :refer [cyclic?]]))
|
||||
(:require [cc.journeyman.the-great-game.utils :refer [cyclic?]]))
|
||||
|
||||
(defn find-routes
|
||||
"Find routes from among these `routes` from `from`; if `to` is supplied,
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
(ns the-great-game.world.run
|
||||
(ns cc.journeyman.the-great-game.world.run
|
||||
"Run the whole simulation"
|
||||
(:require [environ.core :refer [env]]
|
||||
[taoensso.timbre :as timbre]
|
||||
[taoensso.timbre.appenders.3rd-party.rotor :as rotor]
|
||||
[the-great-game.gossip.gossip :as g]
|
||||
[the-great-game.merchants.merchants :as m]
|
||||
[the-great-game.merchants.markets :as k]
|
||||
[the-great-game.world.world :as w]))
|
||||
[cc.journeyman.the-great-game.gossip.gossip :as g]
|
||||
[cc.journeyman.the-great-game.merchants.merchants :as m]
|
||||
[cc.journeyman.the-great-game.merchants.markets :as k]
|
||||
[cc.journeyman.the-great-game.world.world :as w]))
|
||||
|
||||
(defn init
|
||||
([]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
(ns the-great-game.world.world
|
||||
(ns cc.journeyman.the-great-game.world.world
|
||||
"Access to data about the world")
|
||||
|
||||
;;; The world has to work either as map or a database. Initially, and for
|
||||
Loading…
Add table
Add a link
Reference in a new issue