####################################################################################################
#
# DYNAMIS-POP Parameter Generation File 13 - Lower secondary education
# This file is generic and works for all country contexts.
# Input file: globals_for_analysis.RData (To generate such a file run the setup script)
# Last Update: Martin Spielauer 2018-05-12
#
####################################################################################################
####################################################################################################
# Clear work space, load required packages and the input object file
####################################################################################################
rm(list=ls())
library(haven)
library(dplyr)
library(data.table)
library(sp)
library(maptools)
library(survival)
library(fmsb)
library(eha)
load(file="globals_for_analysis.RData")
dat <- g_residents_dat
parafile <- file(g_para_secondary, "w")
####################################################################################################
# WRITE PARAMETERS WITH DEFAULT VALUES
####################################################################################################
# Set Parameter Output File
cat("parameters { \n", file=parafile)
cat(" //EN Lower Secondary Period Direct Progression Intake\n double Educ2DirectProgressionIntake[EDUC_TWO_GEO][EDUC_TWO_GROUP][EDUC_TWO_GRADE][SIM_YEAR_RANGE] = {(606) 0.95};\n", file=parafile, append=TRUE)
cat(" //EN Lower Secondary Period Delayed Progression Intake\n double Educ2DelayedProgressionIntake[EDUC_TWO_GEO][EDUC_TWO_GROUP][EDUC_TWO_GRADE][SIM_YEAR_RANGE] = {(606) 0.95};\n", file=parafile, append=TRUE)
cat(" //EN Lower Secondary Period Success\n double Educ2PeriodSuccess[EDUC_TWO_GEO][EDUC_TWO_GROUP][EDUC_TWO_GRADE][SIM_YEAR_RANGE] = {(606) 0.95};\n", file=parafile, append=TRUE)
cat(" //EN Lower Secondary Period Direct Repetition Intake\n double Educ2DirectRepetitionIntake[EDUC_TWO_GEO][EDUC_TWO_GROUP][EDUC_TWO_GRADE][SIM_YEAR_RANGE] = {(606) 0.95};\n", file=parafile, append=TRUE)
cat(" //EN Lower Secondary Period Delayed Repetition Intake\n double Educ2DelayedRepetitionIntake[EDUC_TWO_GEO][EDUC_TWO_GROUP][EDUC_TWO_GRADE][SIM_YEAR_RANGE] = {(606) 0.95};\n", file=parafile, append=TRUE)
cat(" //EN Maximum years of delays allowed (interruption, repetition of grades)\n int Educ2AllowedDelays = 3;\n", file=parafile, append=TRUE)
cat("\n};\n", file=parafile, append=TRUE)
close(parafile)