view test-data/input/MISTEA/farmer-plan_MISTEA.txt @ 3:3fe3e1e6a40b draft default tip

"planemo upload for repository https://forgemia.inra.fr/insilicow/insilicow-tool commit b530a8209615f225696abe3e0ba49093ff3dc4ad"
author siwaa
date Mon, 25 Aug 2025 16:37:43 +0000
parents
children
line wrap: on
line source

#################################################################################################################
#                                                                                                               #
#	InSiliCow                                                                                               #
#	Virtual farm specification                                                                              #
#                                                                                                               #
#################################################################################################################

#################################################################################################################
#====== GENERAL SETTINGS                                                                                        #
#################################################################################################################

#______ Include files  
@include farmer-log.txt		# providing log action and trigger
@include farmer-base.txt	# providing basic components

#______ Models: specify models for individual cows
param_general{
	garuns_type   = garuns_olivier
	rpm_type      = rpm_lite
	abortion_type = abortion_olivier	
}

#______ Simulation: provide time range, output database and code name
init{
	begin_date  = $start_date$ 00:00:00
	end_date    = $stop_date$ 23:59:59
 	output_db   = db_events.sqlite
 	output_config = config.txt
 	name        = $sim_id$
}

#______ Log Farm information
link{
  trigger = init
  action = log_db farm_tag $farm_tag$
  action = log_db start_date $start_date$
  action = log_db stop_date $stop_date$
  action = log_db now_date $now_date$
  action = log_db latitude $latitude$
  action = log_db longitude $longitude$
}  

#______ End of simulation
trigger{
  type   = chron
  name   = tr_end_simu
  scheme = $stop_date$ 23:59:58 
}

#______ Past and future
condition{
  type = chron_range
  name = past
  from = $start_date$ 00:00:00
  to   = $now_date$ 00:00:01
}

condition{
  type = chron_range
  name = future
  from = $now_date$ 00:00:00
  to   = $stop_date$ 23:59:59
}

#______ Day one
trigger{
    type   = chron
    name   = day_one_herd
    scheme = $start_date$ 23:59:59
}
trigger{
    type = custom
    name = day_one
}
link{
    trigger = day_one_herd
    action  = broadcast_now day_one
}

#______ Calving tag
link{
    trigger = calving
    condition = calf_sex male
    condition = future
    action = log_db birth_of_male no_tag
}
link{
    trigger = calving
    condition = calf_sex female
    condition = future
    action = log_db birth_of_female no_tag
}

#______ Manage initial dam
state{
  state = INITIAL-DAM
}

link{
    trigger = day_one
    action = state_add INITIAL-DAM
}
link{
    trigger = parturition
    condition = is_in INITIAL-DAM
    condition = not is_in IN_WILD
    action = trigger_later tr_delete_cow 1
}
trigger{
  type     = custom
  name     = tr_delete_cow
}
link{
  trigger = tr_delete_cow
  action  = delete_cow remove_initial_dam
}

#______ Stoechio
stoechio{

}

#################################################################################################################
#====== FARMING 												#
#################################################################################################################

#______ Keep cows and calves in farm: no natural mating

link{
  trigger    = enter IN_WILD
  action     = state_move IN_WILD IN_FARM
}

link{
  trigger    = enter WILD_COW
  action     = state_move WILD_COW DRY_COW
}

#______ Remove calf from dam: no natural weaning

link{
  trigger    = enter SUCKLING_CALF
  action     = state_move SUCKLING_CALF NURSED_CALF
}

#______ Milk cows: no natural drying-off at calf weaning

link{
  trigger    = enter NURSING_COW
  action     = state_move NURSING_COW LACTATING_COW
}

#______ Optimal feeding

link{
  trigger    = enter IN_FARM
  action  = trigger_later tr_optimal_feeding 0
}
trigger{
   type = custom
   name = tr_optimal_feeding
}
link{
   trigger = tr_optimal_feeding
   action = change_food optimal
}


#################################################################################################################
#====== FARM COMPONENTS: genotype										#
#################################################################################################################

#______ Genetic_sD: provide Mendelian sampling std dev for transmission of Genetic Scaling Parameters (GSP)
#	GSP_newborn ~ Normal [ (GSP_mother + GSP_father)/2 , GSP_sd ] | within (min, max)

genetic_sd{
	garuns_olivier.WM{   
	  sd  = 0
	  min = 200
	  max = 800
	}
	
	garuns_olivier.khi_M {
	  sd  = 0
	  min = 0.1 
	  max = 0.6
	}
	
	garuns_olivier.b0{
	  sd  = 0
	  min = 0.80
	  max = 2.40
	}
	
	garuns_olivier.nu_X{
      	  sd  = 0
	  min = 0.2
	  max = 1.8
	}
	
	garuns_olivier.nu_Y{
	  sd  = 0
	  min = 0.2
	  max = 1.8
	}
	
	garuns_olivier.nu_F{
          sd  = 0
	  min = 0.50
	  max = 1.50
	}
	
	garuns_olivier.nu_P{
	  sd  = 0
	  min = 0.50
	  max = 1.50
	}

	garuns_olivier.eD_star{
	  sd  =  0
	  min =  9.0
	  max = 15.0
	}

	garuns_olivier.NDF_star{
	  sd  =  0
	  min =  0.10
	  max =  0.90
	}

	garuns_olivier.psi{
	  sd  =  0
	  min =  0.10
	  max =  0.90
	}

	rpm_lite.nu_I{
	  sd  =  0
	  min =  0.00
	  max =  0.20
	}

	rpm_lite.nu_B{
	  sd  =  0
	  min =  1.20
	  max =  2.20
	}

	rpm_lite.nu_Z{
	  sd  =  0
	  min =  0.90
	  max =  1.10
	}
}

#################################################################################################################
#====== FARM COMPONENTS: herd (genotype-based initialization of individual cows)				#
#################################################################################################################


init_cow{
    name=genotype_cow_random
    abortion_olivier.delta   = constant 3.0
    abortion_olivier.enabled = never
    abortion_olivier.dip =  vector constant 17 ; constant 64 
    abortion_olivier.abo = vector constant 0.02  ;  constant 0.005 ; constant 0.0004
    garuns_olivier.WM       =  $WM$
    garuns_olivier.khi_M    =  $khi_M$
    garuns_olivier.b0       =  $b0$
    garuns_olivier.nu_X     =  $nu_X$
    garuns_olivier.nu_Y     =  $nu_Y$
    garuns_olivier.nu_F     =  $nu_F$
    garuns_olivier.nu_P     =  $nu_P$ 
    garuns_olivier.eD_star  =  $eD_star$
    garuns_olivier.NDF_star =  $NDF_star$ 
    garuns_olivier.psi      =  $psi$ 
              rpm_lite.nu_B =  $nu_B$
    	      rpm_lite.nu_Z =  $nu_Z$
              rpm_lite.nu_I =  $nu_I$
}

#______ INITIALIZATION of herd

link{
  trigger = init
  action  = buy_calf genotype_cow_random $nb_cow$
}


#################################################################################################################
#====== FARM COMPONENTS: semen (genotype-based initialization of semen from individual bulls)			#
#################################################################################################################

breed{
  breed = random
}

init_bull{
    name=semen_bull_random
    bull.breed_name     = random
    bull.semens_quality = constant 1 	#100% fertilization
    bull.female_ratio   = constant 0	#100% male calf   
    garuns_olivier.WM       =  $WM$
    garuns_olivier.khi_M    =  $khi_M$
    garuns_olivier.b0       =  $b0$
    garuns_olivier.nu_X     =  $nu_X$
    garuns_olivier.nu_Y     =  $nu_Y$
    garuns_olivier.nu_F     =  $nu_F$
    garuns_olivier.nu_P     =  $nu_P$ 
    garuns_olivier.eD_star  =  $eD_star$
    garuns_olivier.NDF_star =  $NDF_star$ 
    garuns_olivier.psi      =  $psi$ 
              rpm_lite.nu_B =  $nu_B$
    	      rpm_lite.nu_Z =  $nu_Z$
              rpm_lite.nu_I =  $nu_I$
}


#################################################################################################################
#====== FARM COMPONENTS: heat detection 									#
#################################################################################################################

estrous_detection_method{
  name=perfect
  #time_slice = 06:00:00 18:00:00
  time_slice = 00:00:00 23:59:59
  expression_threshold=0.75
  expression_stiffness=7
  detection_threshold=0.05
  sensitivity = 1
  wrong_oestrus_per_day = 0
}

#################################################################################################################
#====== FARM COMPONENTS: feedstuffs	 									#
#################################################################################################################


#################################################################################################################
#====== FARM COMPONENTS: diets		 									#
#################################################################################################################


#################################################################################################################
#====== FARM COMPONENTS: time schemes	 									#
#################################################################################################################


#################################################################################################################
#====== FARM COMPONENTS: groups		 									#
#################################################################################################################


#################################################################################################################
#====== FARM COMPONENTS: operations	 									#
#################################################################################################################

link{
 trigger = enter IN_FARM
 action = state_add IMMORTAL
}

link{
 trigger = enter INITIAL-DAM
 action = state_delete INITIAL-DAM
}

link{
  trigger    = ovulation
  condition  = is_in mature
  condition  = future
  action     = estrous_start perfect
}

link{
  trigger   = estrous
  condition = is_in mature
  condition = not is_pregnant
  condition = future
  condition = not days_after_calving < 50
  action    = inseminate semen_bull_random
}

link{
  trigger   = conception
  condition = future
  action    = estrous_stop
}

link{
  trigger    = abortion
  condition  = future
  action     = estrous_start perfect
}

link{
  trigger    = parturition
  #action     = trigger_later stop_milking 305
 action     = trigger_later tr_drying_off 305
 }

trigger{
  type = custom
  name = tr_drying_off
}

link{
  trigger = tr_drying_off
  action = stop_milking
  action = log_db stop_milking: 305 days after calving
}


#################################################################################################################
#====== FARM COMPONENTS: transfers	 									#
#################################################################################################################


#################################################################################################################
#====== FARM COMPONENTS: perturbations	 									#
#################################################################################################################


#################################################################################################################
#====== FARM COMPONENTS: parcels	 									#
#################################################################################################################