GithubHelp home page GithubHelp logo

oliver-be / ring-of-fire Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 51.25 MB

A parallelized genetic program for evolving rules that describe a cellular automaton-based wildfire simulation.

License: Eclipse Public License 2.0

Clojure 78.98% Batchfile 19.78% Shell 1.24%

ring-of-fire's Introduction

Oliver's github stats

ring-of-fire's People

Contributors

carusoisaac34 avatar icaruso21 avatar mglusker avatar oliver-be avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ring-of-fire's Issues

Cut down on number of instructions

We need to look at our instructions to make sure all of them make sense and perhaps remove some that logically would not affect fire spread. Specifically, we should look at the weather data and decide whether or not each column has relevant data (if there is data that doesn't change much across 24 hours then we shouldn't waste time by having it be an instruction). In short, we should cut down on the number of weather variables we are looking at, if possible.

We should also consider consolidating weather variables into more useful data points such as wind direction that our program could then use in lieu of many different weather variables and having to figure it out itself.

Look at this result!

Report for Generation 2
-------------------------------------------------------
Best plushy: (sw n integer_% false false e exec_dup e integer_* w sw WD DMC false exec_if)
Best program: (sw n integer_% false false e exec_dup (e integer_* w sw WD DMC false exec_if () ()))
Best total error: 672
Fires evaluated: (m1)

Condor stuff from andy?

Thanks for that.

FYI I'm including below a reply from Andy, which adds a bunch of additional info.

Some of the formatting may not be great, but Moodle does unfortunate things (html escaping) with some characters in markdown literal mode, so I'm just formatting this as plain text... if you want some of the output to line up better, paste it into something that uses fixed-width fonts.

Issac, your runs get singled out here because those are the ones that are currently in the pipeline; don't take it personally!

-Lee

--- from Andy:

Hold usually means it can’t start the job for some reason. Idle may means it’s waiting for nodes, and that can be because it’s been running for a while and has been “evicted”. At the moment I see that almost all of the nodes are busy:

$ condor_status -sched
TotalRunningJobs TotalIdleJobs TotalHeldJobs
Total 86 317 1

So there’s a lot of competition for nodes. It may also take a while to get running because the available nodes don’t have the necessary resources, e.g. not enough memory is available. Many of Isaac’s jobs are 10–12 GB in size, when on average there is only 8 GB per job available (nodes 1-3) or 4 GB per job available (nodes 4–6).

He currently has one held job, sitting there for a day and a half, the reason is:

$ condor_q -held 725.3

-- Schedd: csc3-desktop.amherst.edu : <148.85.78.197:9618?... @ 04/30/20 02:26:42
ID OWNER HELD_SINCE HOLD_REASON
725.3 icaruso21 4/28 18:31 Failed to initialize user log to /home/icaruso21/ring-of-fire/prod-results-v2s/timestep1/3/log

but the actual directory name is /home/icaruso21/ring-of-fire/prod-results-v2/timestep1/3 . (“v2” not “v2s”).

Important: please remind the students to put their projects into cluster-archive. Their home directory has relatively limited space available.

— Andy

COMPARE GRIDS

Can we leave the output of compare grids (which determines our error vector for lexicase selection) as a lazy sequence or does it need to be a vector? Casting an extremely large lazy sequence as a vector means that we are potentially wasting lots of time each time we call our fire-error-function

add informative print statements to generation reports

Since different fires with different dimensions are being tested on each generation, we should both print out that total number of cells for the fire(s) chosen and a simple percent error print statement to better help sift through our results

RUN TIME

We need to figure out where the bulk of our runtime is occurring. It seems that it is likely in run-fire when we have a small time-step (meaning we only increase time by a small amount for each loop), but we need to explore other parts of our program to narrow this down so we can run more generations at a higher time step

Fix lexicase

(defn lexicase-selection
"Selects an individual from the population using lexicase selection."
[pop argmap]
(loop [survivors pop
cases (shuffle (range (count (:errors (first pop)))))]
(if (or (empty? cases)
(empty? (rest survivors)))
(rand-nth survivors)
(let [min-err-for-case (apply min (map #(nth % (first cases))
(map :errors survivors)))]
(recur (filter #(= (nth (:errors %) (first cases)) min-err-for-case)
survivors)
(rest cases))))))

To run

-------------------------------------------------------
Report for Generation 1
-------------------------------------------------------
Best plushy: (exec_dup boolean_and WS boolean_not 2 integer_* integer_= TB integer_% NT WD WD close 0 WD boolean_not FWI FWI exec_dup 1 integer_+ TB false close exec_dup WS)
Best program: (exec_dup (boolean_and WS boolean_not 2 integer_* integer_= TB integer_% NT WD WD) 0 WD boolean_not FWI FWI exec_dup (1 integer_+ TB false) exec_dup (WS))
Best total error: 6877
Total number of cells: 24280
Best percent error: 0.28323722
Fires evaluated: (r1 g2 m1 k2)

Error during evolution

Could the pmap mean that sometimes the second vector item gets returned before the first, causing an issue?
Capture

slope data?

Do we want to use slope data? If so, we would need to get rid of arrowhead 2 from the training set (and potentially altogether) as it contains missing slope data. (We could only test on it if the program does not include slope)

fix lexicase selection

implement the "pick 1 per error" function that professor Spector was talking about to speed up runtime

create map of weather data points

In update-cell we might save a bunch of time by creating a weather dictionary of all of our individual value instead of calling the lookup function we created on 8 different variables

IndexOutOfBounds Exception Error in a Job

So one of our lightweight jobs discovered an error... could be what @Oliver-BE mentioned in the other error issue.

Exception in thread "main" Syntax error compiling at (/ac3/tmpswp/tmp/form-init7442808551700045961.clj:1:84).
at clojure.lang.Compiler.load(Compiler.java:7647)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.IndexOutOfBoundsException
at clojure.lang.PersistentVector.arrayFor(PersistentVector.java:158)
at clojure.lang.PersistentVector.nth(PersistentVector.java:162)
at clojure.lang.RT.nth(RT.java:892)
at ring_of_fire.propel_helper$lexicase_selection$fn__389.invoke(propel_helper.clj:499)
at clojure.core$map$fn__5851.invoke(core.clj:2755)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.boundedLength(RT.java:1788)
at clojure.lang.RestFn.applyTo(RestFn.java:130)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$apply.invoke(core.clj:660)
at ring_of_fire.propel_helper$lexicase_selection.invokeStatic(propel_helper.clj:499)
at ring_of_fire.propel_helper$lexicase_selection.invoke(propel_helper.clj:491)
at ring_of_fire.propel_helper$select_parent.invokeStatic(propel_helper.clj:510)
at ring_of_fire.propel_helper$select_parent.invoke(propel_helper.clj:505)
at ring_of_fire.propel_helper$new_individual.invokeStatic(propel_helper.clj:552)
at ring_of_fire.propel_helper$new_individual.invoke(propel_helper.clj:545)
at ring_of_fire.propel_helper$propel_gp$fn__420.invoke(propel_helper.clj:595)
at clojure.core$repeatedly$fn__6448.invoke(core.clj:5149)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:531)
at clojure.core$seq__5387.invokeStatic(core.clj:137)
at clojure.core$take$fn__5894.invoke(core.clj:2884)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:531)
at clojure.core$seq__5387.invokeStatic(core.clj:137)
at clojure.core$map$fn__5851.invoke(core.clj:2746)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.next(RT.java:709)
at clojure.core$next__5371.invokeStatic(core.clj:64)
at clojure.core$pmap$step__8452.invoke(core.clj:7023)
at clojure.core$pmap.invokeStatic(core.clj:7028)
at clojure.core$pmap.invoke(core.clj:7012)
at ring_of_fire.propel_helper$propel_gp.invokeStatic(propel_helper.clj:587)
at ring_of_fire.propel_helper$propel_gp.invoke(propel_helper.clj:574)
at ring_of_fire.core$_main.invokeStatic(core.clj:582)
at ring_of_fire.core$_main.doInvoke(core.clj:578)
at clojure.lang.RestFn.invoke(RestFn.java:805)
at clojure.lang.Var.invoke(Var.java:460)
at user$eval140.invokeStatic(form-init7442808551700045961.clj:1)
at user$eval140.invoke(form-init7442808551700045961.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)

And this is the output data that causes the error:

Starting GP with args: {:max-initial-plushy-size 30, :instructions (elevation APCP TMP RH WS WD FFMC DMC DC ISI BUI FWI current-value time-step nw n ne e w sw s se num-burning-neigh integer_+ integer_- integer_* integer_% integer_= exec_dup exec_if boolean_and boolean_or boolean_not boolean_= close 0 1 2 true false), :fire-selection 3, :max-generations 2500, :time-step 50, :parent-selection :lexicase, :tournament-size 5, :step-limit 10, :error-function #object[ring_of_fire.core$fire_error_function 0x7fcbe147 ring_of_fire.core$fire_error_function@7fcbe147], :population-size 4}
-------------------------------------------------------
Report for Generation 0
-------------------------------------------------------
Best plushy: (integer_* boolean_not TMP boolean_or 0 DC DC DC elevation exec_dup FFMC 0 2 w DC boolean_= time-step RH integer_* BUI boolean_or false DC 0 elevation)
Best program: (integer_* boolean_not TMP boolean_or 0 DC DC DC elevation exec_dup (FFMC 0 2 w DC boolean_= time-step RH integer_* BUI boolean_or false DC 0 elevation))
Best total error: 8225
-------------------------------------------------------
Report for Generation 1
-------------------------------------------------------
Best plushy: (BUI RH current-value WD 1 w FWI nw DC n exec_if 0 WD BUI boolean_or DMC boolean_and BUI ne sw 2 false)
Best program: (BUI RH current-value WD 1 w FWI nw DC n exec_if (0 WD BUI boolean_or DMC boolean_and BUI ne sw 2 false) ())
Best total error: 8225

m1 outcome

Report for Generation 9
-------------------------------------------------------
Best plushy: (n APCP n DC num-burning-neigh time-step TMP FFMC n se integer_- FFMC integer_- APCP 1 TMP ISI boolean_and exec_if exec_if exec_if close TMP TMP current-value)
Best program: (n APCP n DC num-burning-neigh time-step TMP FFMC n se integer_- FFMC integer_- APCP 1 TMP ISI boolean_and exec_if (exec_if (exec_if () (TMP TMP current-value)) ()) ())
Best total error: 673
Fires evaluated: (m1)

training testing set

set aside 3 fires that are to be tested on (and never trained on in the error function)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.