diff --git a/Makefile b/Makefile index 91edc67485a55575d77fac94f4b49a0d8b6abf53..2a26fec2551154c87d9be5446eb7bbc2ec3ef077 100644 --- a/Makefile +++ b/Makefile @@ -23,16 +23,16 @@ docs: profile: # run and profile an example simulation - if [ -d "example_results" ]; then rm -r example_results; fi - ./runprofile.jl -o example_results + if [ -d "profile_results" ]; then rm -r profile_results; fi + ./runprofile.jl -o profile_results container: #TODO create a Singularity container - echo "Not yet implemented (#43)" + echo "Not yet implemented (#43)." release: echo "Not yet implemented." install: #TODO install Julia and/or package dependencies? - echo "Not yet implemented." + echo "Not yet implemented (#67)." diff --git a/runprofile.jl b/runprofile.jl index a223bfd313e1a472cc1c52ba611cba6129446ed8..ff21e0f806b869b25b87cdaffceacff6203b5957 100755 --- a/runprofile.jl +++ b/runprofile.jl @@ -11,11 +11,11 @@ Profile.clear() @profile simulate() -open("profile_flat.txt", "w") do s +open("profile_results/profile_flat.txt", "w") do s Profile.print(IOContext(s, :displaysize=>(300,145)), format=:flat, mincount=10, sortedby=:count) end -open("profile_tree.txt", "w") do s +open("profile_results/profile_tree.txt", "w") do s Profile.print(IOContext(s, :displaysize=>(300,300)), mincount=10) end diff --git a/src/nature/species/skylark.jl b/src/nature/species/skylark.jl index 94c3bd1f9712b943468b5ec905e2e6859dd82092..87ac542384d8fee33e60a64e7056e2bd654fe173 100644 --- a/src/nature/species/skylark.jl +++ b/src/nature/species/skylark.jl @@ -88,9 +88,14 @@ end Non-breeding adults move around with other individuals and check for migration. """ @phase Skylark nonbreeding begin - #XXX is flocking behaviour important? It may be quite computationally expensive... + #FIXME searching for neighbours is *the* performance bottleneck!! + # Two options: + # (a) ignore flocking, simply move randomly (scientifically OK, doesn't look as good) + # (b) select a random neighbour once, then keep following that individual + # flocking behaviour - follow a random neighbour or move randomly - neighbours = @neighbours(self.visionrange) #XXX check for the closest neighbour(s)? + neighbours = () + #neighbours = @neighbours(self.visionrange) #XXX check for the closest neighbour(s)? isempty(neighbours) ? @walk("random", self.movementrange) : @follow(@rand(neighbours), 30m) #XXX magic number