Description of the functions that define the mosquito life-cycle model.

M-BITES: Mosquito Bout-based and Individual-based Transmission Ecology Simulation

Female M-BITES

Core Functions

Female M-BITES functions are largely defined in MBITES-Bouts.R, calling other source files as appropriate. Due to the number and complexity of the female life cycle model, and future development of new life stages or more detailed implementations of current work should define new MBITES-MODULE.R source files if differences with existing code are significant.


Generic function to be called for every bout. The mechanism is described below.

  1. Update time and state:
    • Upon entering a bout, a mosquito’s tNow is updated to tNext. All computations within the bout (all survival, energetics, as well as the bout itself, boutFun), must only make reference to tNow as the main calling function MBITESi().
    • After updating tNow, state is updated to stateNew; all computations within the bout must assume the current state is “state”; stateNew will be modified during the bout. All functions within a bout should make appropriate use of isAlive() and/or isActive() so that if a mosquito’s stateNew is set to dead during a function call it is non subsequently overwritten.
    • Finally, timingExponential() will update tNext based on current state, “state”. This is the holding time of the mosquito in this state until the next state transition (ie; we view the mosquito as a discrete-time Markov process with exponential holding times, which is equivalent to a continuous-time Markov process, but we do not directly specify the infentesimal generator matrix Q; this is why we update tNext regardless of the next state, because we are sampling the time spent in the current state).
  2. Movement:
    • rMove() returns a list of the new point set of the mosquito and the new site index she moved to. If new point sets are added, movement rules must be appropriately added to the function, found in MOVEMENT/movement.R *
boutGeneric <- function(M,P,boutFun,...){

  # update time and state
  M$tNow = M$tNext # update time
  M$state = M$stateNew # update current state
  M = timingExponential(M,P) # update tNext

  # movement
  move = rMove(ix = M$ix,pSet = M$inPointSet,bState = M$state)
  M$ix = move$ixNew
  M$inPointSet = move$pSetNew

  # bout
  M = boutFun(M,P,...)

  # energetics
  M = energetics(M,P)

  # landing spot
  M = landingSpot(M,P)

  # survival
  M = surviveResting(M,P)
  M = surviveFlight(M,P)

  # check queueing
  # queueEstivation()
  # queueMating() only queue if mated = FALSE



Core Functions

Male-specific M-BITES functions are mostly defined in MBITES-Swarming.R because of the restricted number and complexity of the male life cycle model.