curr: Extract currency (or currencies) from a cell.

Description Usage Arguments Details Value Examples

View source: R/curr.R

Description

Function to calculate currency(-ies) in a given cell. Called by optimLoadCurr

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
curr(
  L_i,
  L_max_i,
  n_i,
  h_i,
  p_i,
  f_i,
  d_i,
  v_i,
  beta_i,
  H_i,
  c_i,
  c_f,
  whatCurr_i,
  mu,
  l,
  e,
  NumFls,
  alphaVal,
  sumAll = T,
  forageType = "random"
)

Arguments

L_i

Load size (μL)

L_max_i

Maximum load size (μL)

n_i

Number of foragers in the cell

h_i

Handling time per flower (s)

p_i

Licking speed for nectar (μL/s)

f_i

Flight time between flowers (s)

d_i

Distance from hive (m)

v_i

Unloaded flight speed from hive (m/s)

beta_i

Decrease in flight speed with load (m/sμL)

H_i

Time spent inside hive (s)

c_i

Cost of non-flying behaviour (J/s)

c_f

Cost of flight (J/s)

whatCurr_i

Currency to use. Must be either "rat" (net rate) or "eff" (efficiency)

mu

Per-flower nectar production (μL/s)

l

Maximum standing crop per flower (μL)

e

Energetic value of nectar (J/μL)

NumFls

Number of flowers per patch

alphaVal

Increase in metabolic rate with load (J/(s*μL))

sumAll

Should currencies for the cell be summed? (useful for optimization of L) If not, returns a vector of currencies.

forageType

Foraging style (see details below).

Details

forageType can be one of the following:

Value

Summed currency, or vector of currencies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Parameters
params <- list(L_i=59.5,L_max_i=59.5,n_i=10,h_i=1.5,p_i=1,
           f_i=0.86,d_i=100,v_i=7.8,alphaVal=0.013,
           beta_i=0.102/59.5,H_i=100,c_f=0.05,c_i=0.0042,
           mu=0.3/3600,l=1,e=14.35,NumFls=520*(10^2))

temp1 <- with(params,
    curr(L_i,L_max_i,n_i,h_i,p_i,f_i,d_i,v_i,beta_i,H_i,
             c_i,c_f,mu,l,e,NumFls,whatCurr_i='eff',sumAll=FALSE,
             alphaVal,forageType='omniscient'))

temp1['eff'] #Efficiency within cell
temp1['S'] #Reduction in per-flower value

samuelVJrobinson/CPForage documentation built on Jan. 20, 2021, 6:22 p.m.