1: Preparation for conversion to CLJC. Doesn't yet fully work but that seems

to be due to a breaking change in a library.
This commit is contained in:
simon 2016-09-24 10:29:34 +01:00
parent f1b35dc948
commit 6237eab0cd
13 changed files with 50 additions and 49 deletions

View file

@ -1,13 +1,13 @@
(ns ^{:doc "Simple functions to allow a world to be visualised."
:author "Simon Brooke"}
mw-engine.display
microworld.engine.display
(:require [hiccup.core :refer [html]]
mw-engine.utils
mw-engine.world))
microworld.engine.utils
microworld.engine.world))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,14 +1,14 @@
(ns ^{:doc "Functions to transform a world and run rules."
:author "Simon Brooke"}
mw-engine.core
microworld.engine.core
(:require [clojure.core.reducers :as r]
[mw-engine.world :as world]
[mw-engine.utils :refer [get-int-or-zero map-world]])
[microworld.engine.world :as world]
[microworld.engine.utils :refer [get-int-or-zero map-world]])
(:gen-class))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License

View file

@ -2,16 +2,16 @@
compute drainage on a world, assumed to have altitudes already set
from a heightmap."
:author "Simon Brooke"}
mw-engine.drainage
(:require [mw-engine.core :refer [run-world]]
[mw-engine.heightmap :as heightmap]
[mw-engine.utils :refer [get-int-or-zero get-least-cell get-neighbours
microworld.engine.drainage
(:require [microworld.engine.core :refer [run-world]]
[microworld.engine.heightmap :as heightmap]
[microworld.engine.utils :refer [get-int-or-zero get-least-cell get-neighbours
get-neighbours-with-property-value
map-world]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,16 +1,16 @@
(ns ^{:doc "Functions to apply a heightmap to a world."
:author "Simon Brooke"}
mw-engine.heightmap
microworld.engine.heightmap
(:import [java.awt.image BufferedImage])
(:require [fivetonine.collage.util :as collage :only [load-image]]
[mikera.image.core :as imagez :only [filter-image get-pixels]]
[mikera.image.filters :as filters]
[mw-engine.utils :refer [abs get-int get-neighbours map-world]]
[mw-engine.world :refer [make-world]]))
[microworld.engine.utils :refer [abs get-int get-neighbours map-world]]
[microworld.engine.world :refer [make-world]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
@ -42,7 +42,7 @@
If the heightmap you supply is smaller than the world, this will break.
* `world` not actually used, but present to enable this function to be
passed as an argument to `mw-engine.utils/map-world`, q.v.
passed as an argument to `microworld.engine.utils/map-world`, q.v.
* `cell` a cell, as discussed in world.clj, q.v. Alternatively, a map;
* `property` the property (normally a keyword) whose value will be set on the cell.
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
@ -86,7 +86,7 @@
If the heightmap you supply is smaller than the world, this will break.
* `world` not actually used, but present to enable this function to be
passed as an argument to `mw-engine.utils/map-world`, q.v.;
passed as an argument to `microworld.engine.utils/map-world`, q.v.;
* `cell` a cell, as discussed in world.clj, q.v. Alternatively, a map;
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
exceed those of the world of which the `cell` forms part."

View file

@ -1,12 +1,12 @@
(ns ^{:doc "A set of MicroWorld rules describing a simplified natural ecosystem."
:author "Simon Brooke"}
mw-engine.natural-rules
(:require mw-engine.utils
mw-engine.world))
microworld.engine.natural-rules
(:require microworld.engine.utils
microworld.engine.world))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,13 +1,13 @@
(ns ^{:doc " Utility functions needed by MicroWorld and, specifically, in the
(ns ^{:doc "Utility functions needed by MicroWorld and, specifically, in the
interpretation of MicroWorld rule."
:author "Simon Brooke"}
mw-engine.utils
microworld.engine.utils
(:require
[clojure.math.combinatorics :as combo]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,12 +1,12 @@
(ns ^{:doc "Functions to create and to print two dimensional cellular automata."
:author "Simon Brooke"}
mw-engine.world
microworld.engine.world
(:require [clojure.string :as string :only [join]]
[mw-engine.utils :refer [population]]))
[microworld.engine.utils :refer [population]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-engine: the state/transition engine of MicroWorld.
;;;; microworld.engine: the state/transition engine of MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License