Skip to content
Snippets Groups Projects
Select Git revision
  • e82aa559f8c3845405f7661a10dfe66792b37dee
  • master default protected
  • development
  • marco/aquacrop-regional-params
  • precompile-statements
  • precompile-tools
  • tmp-faster-loading
  • skylark
  • testsuite
  • code-review
  • v0.7.0
  • v0.6.1
  • v0.6.0
  • v0.5.5
  • v0.5.4
  • v0.5.3
  • v0.5.2
  • v0.2
  • v0.3.0
  • v0.4.1
  • v0.5
21 results

skylark.jl

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    skylark.jl 1.12 KiB
    ### Persefone - a socio-economic-ecological model of European agricultural landscapes.
    ###
    ### This file holds the code for the Eurasian Skylark (Alauda arvensis).
    ###
    
    """
        Skylark
    
    *Alauda arvensis* is a common and charismatic species of agricultural landscapes.
    At the moment, this implementation is still in development.
    """
    @species Skylark begin
    
        popsize = Int(round(1/10000*reduce(*, size(model.landscape))))
        lifeexpectancy = 365*5
    
        eggharvestmortality = 0.9
        eggpredationmortality = 0.1
        
        initialise! = initrandompopulation(popsize)
    
        habitats = @habitat((@landcover() == grass || 
                             (@landcover() == agriculture && @croptype() != maize &&
                              @cropheight() < 10)) &&
                            @distanceto(forest) > 20)
        
        @phase egg begin
            @kill(@trait(eggpredationmortality), "predation")
    
            #TODO dies if parents die
            
            @respond harvest @kill(@trait(eggharvestmortality), "harvest")
    
            if @trait(age) == 14
                @setphase(nestling)
            end
        end
    
        @phase nestling begin
            #TODO
        end
    
        #TODO
    end