Skip to content
Snippets Groups Projects
Commit b7a84c85 authored by xo30xoqa's avatar xo30xoqa
Browse files

Profiled a run, turned off flocking behaviour in skylarks

Searching for neighbours turned out to consume ~80% of processing time...
parent f925cb99
No related branches found
No related tags found
No related merge requests found
......@@ -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)."
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment