package MpmasQLRegistry;

our %cfg_entries = (
	STARTYEAR => undef,
	ENDYEAR => undef,
	STARTMONTH => 1,
	ENDMONTH => 12,
	STARTDAY => 1,
	ENDDAY => 31,
	SPINUPS => 0,
	SEASONSTART => 1,
	SEASONEND => 12,
	IRRIGMONTH => 0,
	NORTHERN => 1,
	
	PERIODS_PER_YEAR => 1, # will curently  only work with 1,2,3,4,6,12
	SEASON_OF_START_PERIOD => 1,
	
	
	#HOUSEHOLD_DYNAMICS_YEARLY => 1,
	

	MULTIPERIOD => 1,
	
	MATRIX_TRIPLETS	=> 0,
	_INPUT_DELIMITERS => 1,


	POPULATIONS => 1,
	CLUSTERS => 1,

	DEMOGRAPHY_MODEL => 0,

	INCOME_BALANCE_ROW	=>	-1,
	RHS_FIX_COST		=>	-1,
	RHS_MIN_CONS		=>	-1,


	CASHFLOW_COEF		=>	-1,
	CASHFLOW_RHS		=>	-1,
	CASHFLOW_RHS_MINCONS	=>	-1,

	TERRAINMAPSTUB => undef,

	NFARMASSETS => 10,
	ASSETDISTTYPE => 2,
	GENERATE_MAPS => 0,


	AGENT_INFO_FROM_MAPS => 1,
	MAPS => undef,

	CELLSIZE => 1,
	NUM_PLOT_CAPACITY_LAYERS => 0,
	NSOIL => 1,
	NNRU => 0,
	STATICNRU => 1,
	NUDEF => 0,
	NUDEF_FOR_NRU_DEFINITION => 0,
	
#	MAXSLOTS => 10000,

	EXTERNALCGFORMAT0 => 0,

	DYNAMIC_SOIL_TRANSITIONS => 0,

	NINFLOWS => 0,
	VINFLOWS => 1,


	NETWORKS => 1,

	CURRENCY => "Euro",
	CURRENCYSCALE => 1,

	MARKETS => 1,

	PRODUCER_ORGS => 0,


	XC_SAV_LOGIT => 0,

	CROP_MODEL => 0,
	BIOVERSION => 0,
	LANDSCAPE_MODEL => 0,
	IRRIGATION => 0,
	LANDMARKET_MODEL => 0,
	COUNTRY => 0,
	EDICEXTENDEDCANAL => 0,
	POLICY_MODEL => 0,
	EXTERNAL_CROP_MODEL => -1,
	XNDEBUGFILES => 0,
	HARVEST_DECISION => 0,

	EXO_YIELD_EXPECTATIONS => 0,
	
	
	DIGS => 4,

	PRE_INVESTMENT_EXTERNAL_SCRIPT => 0,
	INYEAR_EXTERNAL_SCRIPT => 0,
	CROP_MODEL_EXTERNAL_SCRIPT => 0,
	
#	PRE_INVESTMENT_EXTERNAL_SCRIPT_ARGUMENTS => 1,
#	INYEAR_EXTERNAL_SCRIPT_ARGUMENTS => 1,
	
	CROP_MODEL_WANTS_MANAGEMENT_ID => 0,
	
	COMMON_PROPERTY  => 0,

	#for backward compatibility
	PERMCROP_MODEL => 0,
	LIVESTOCK_MODEL => 0,


	RNGSTREAM => 1,

	OFFLIQEQ => 0,
	OFFHHAGING => 0,
	OFFLIVEAGE => 0,
	OFFASSAGE => 0,
	OFFINV => 0,
	OFFINVDELAY => 0,
	OFFDYNSOIL => 1,
	OFFDYNFLOW => 1,
	MINOBJ => 0,
	LOTTERYLOOPS => 30,
	OSL_MAXSOLVETIME => -1,
	OSL_MAXITERATE => 99999999,
	OSL_MAXNODES => 9999999,
	OSL_SEQUENCE => 4,

	OSL_M4_ATTEMPTS => 2,
	OSL_M4_ITHRESH => -1,
	OSL_M4_NTHRESH => -1,
	OSL_M4_STHRESH => -1,
	OSL_M4_LP_PRESOLVE => 1,
	OSL_M4_LP_PRESOLVE_ONFAIL  => 1,
	OSL_M4_SCALE  => 1,
	OSL_M4_SCALE_ONFAIL  => 1,
	OSL_M4_CRASH  => 1,
	OSL_M4_CRASH_ONFAIL  => 1,
	OSL_M4_CRASHMODE  => 1,
	OSL_M4_I_PRESOLVE  => 2,
	OSL_M4_I_PRESOLVE_ONFAIL   => 1,
	OSL_M4_I_STRATEGY   => 1,
	OSL_M4_I_HEURPASS   => 1,
	OSL_M4_ACCEPT_DIFF   => 0,
	OSL_M4_ACCEPT_RELDIFF   => 0,
	OSL_M4_CONT_ONFAIL   => 1,
	OSL_M4_MODE3_ONFAIL   => 0,
	OSL_M4_I_PRE_ADDROWS   => 0,
	OSL_M4_LOG   => 0,

	XNSEASONS   => 1,

	SHDW_SWITCH   => 0,

	MAXAGEPERM   => 0,
	DURPOLICY   => 0,
	POLICY_EUCAP2003   => 0,

	OUTPUT_ALL   => 1,

	NEW_FARMSTEAD_ID_SHIFTER => 100000,
	NEW_FARMSTEAD_ID_MULTIPLIER => 1000,

	LAND_REDISTRIBUTION_MODEL => 0,
	LAND_REDISTRIBUTION_PARTIAL_ALLOWED => 0,
	LAND_REDISTRIBUTION_FREE_AT_START	=> 0,
	LAND_REDISTRIBUTION_PLOTS_FROM_LP => 0,
	LAND_REDISTRIBUTION_PLOTS_ABANDONED => 0,
	LAND_REDISTRIBUTION_PLOTS_EMERGENCY_SOLD => 0,


	LIVSIM_AGE_TO_MPMAS_AGE	=>	undef,
	LIVSIM_MPMAS_AGE_PRECISION_FACTOR	=> 10000,
	LIVSIM_MPMAS_BW_PRECISION_FACTOR	=> 10,

	ADDITIONAL_DECISION_STAGES => 0,
	ADVANCED_EXPECTATIONS => 0,
	
	LIMIT_FOR_IMMEDIATE => 50000,
	ADDITIONAL_PRICE_PERIODS => 0,
	
	LIST_SIMRUN_PARAMETERS => 0

	
);
our %cfg_lists = (
	EXTRA_HHMEMBER_CHARACTERISTICS => [],
	EXTRA_CROPACT_CHARACTERISTICS => [],
	EXTRA_AGENT_ATTRIBUTES => [],

	THRESHOLDS => [(0)],
	INYEAR_EXTERNAL_SCRIPT_CHANGED_UDEF_MAPS => [],
	
	INYEAR_EXTERNAL_SCRIPT_READ_IN => ["Assets"],    #Assets, Attributes
	INYEAR_EXTERNAL_SCRIPT_WRITE_OUT => ["Assets"],  #Assets, Attributes, Solutions

	PRE_INVESTMENT_EXTERNAL_SCRIPT_READ_IN => ["Assets"],    #Assets, Attributes
	PRE_INVESTMENT_EXTERNAL_SCRIPT_WRITE_OUT => ["Assets", "Solutions"],   #Assets, Attributes, Solutions
	
	TABLES_AS_EXTRA_INPUT =>[]
);

our %mpmas_tables = (
	HOUSEHOLD_DYNAMICS => 3, 
	HOUSEHOLD_SWITCHING => 4, 
	HOUSEHOLD_MEMBER_TYPES => 1, 
	HOUSEHOLD_SWITCHING_UDEF => 4,
	HOUSEHOLD_CAREER_INFO => 2,

	ASSET_ENDOWMENTS => 2, 
	HOUSEHOLD_COMPOSITION => 2, 

	ASSET_OWNERSHIP => 3, 
	HOUSEHOLD_MEMBERS => 4,


	HOUSEHOLD_CDF => 4, 
	ASSET_CDF => 4, 
	SEEDS => 1, 
	REGION => 1, 

	AGENT_INFO  => 1, 

	INNOVATIONS  => 3, 
	SEGINFO  => 3, 
	SEGBOUNDS  => 3, 

	STANDARD_LAND_RENTS  => 3, 
	INITIAL_LAND_RENTS  => 1, 
	INFPROJ  => 1, 
	INFPROJPARTICIPANTS  => 2, 


	NRU_COMPATIBILITY  => 1, 
	SOIL_COMPATIBILITY  => 1, 
	SOIL_SIMILARITY  => 2, 
	CROP_SIMILARITY  => 3, 
	SOIL_DISTANCE => 1,
	SOIL_DISTANCE_UDEF => 1,

	EXTERNAL_CG_YIELDS  => 2, 
	EXTERNAL_CG_YIELD_EXPECTATIONS  => 2, 
	EXTERNAL_CG_INFO_MULTIPERIOD  => 2, 
	EXTERNAL_CG_INFO_REQUIRED_ASSETS  => 2, 

	PRODUCER_ORGANIZATIONS  => 1, 
	PRODUCER_ORGANIZATION_SERVICES  => 2, 

	PRICES  => 3, 
	PRICES_PERIODS => 4,
	
	INITIAL_PRICE_EXPECTATIONS  => 2, 
	
	SEASONAL_DATA => 3,
	EXOGENOUS_CHANGES => 4,
	
	LIVSIM_ASSET_LINK => 6,
	LUCIA_LIVSIM_PASTURE_ID => 2,
	
	DECISION_STAGES_DATA => 2, 
	
	EXPECTATION_PARAMETERS => 3,
	
	COMMON_PROPERTY_GROUP_MEMBERS => 2,
	
	AGENT_ATTRIBUTES => 2
);

our %mpmas_parameters = (

	FEMHEAD	=> 0,
	INNOVATIVENESS => 0,
	EXPECTATIONS => 0,
	LIQUIDITY => 0, 
	LEVERAGE => 0,
	TIMEPREF => 0,
	ZERO_SAVINGS_PROB => 0,

	ASSETMAXAGE => 7,
	ASSETMINAGE => 0,
	MINWATER => 1,

	INVESTMENT_HORIZON_MODEL => 0,
	SCONEXTRA => 0,
	SCONMIN => 0,
	SCONRED => 1,
	CONSTYPE => 0,
	SUCCESSION_AD_MINCONS_FACTOR => -9999,
	SUCCESSION_AD_MINIMUM_PROFIT => -999999999,
	SUCCESSION_AD_DECISION_ACTIVITY => undef,

	SUCCESSION_VR_MINCONS_FACTOR => -9999,
	SUCCESSION_VR_MINIMUM_PROFIT => -999999999,
	SUCCESSION_VR_DECISION_ACTIVITY => undef,

	SUCCESSION_VR_MINIMUM_RENTAL => 0,

	SUCCESSION_OR_MINCONS_FACTOR => -9999,
	SUCCESSION_OR_MINIMUM_PROFIT => -999999999,
	SUCCESSION_OR_DECISION_ACTIVITY => undef,


	SUCCESSION_CONTROL => undef,

	OPPWAGE => 0,
	INTEREST_LGCRD => 0.07,
	INTEREST_SHCRD => 0.09,
	INTEREST_SHDEP => 0.02,
	DISCOUNT_RATE => undef,


	RESELL => 0,
	EQSHARE => 1,
	INCTRANS => 0,

	WHICH_MARKET => 0,

	LIQRESERVE => 0,
	RNG_HME_1 => 12345,
	RNG_HME_2 => 12345,
	RNG_HME_3 => 12345,
	RNG_HME_4 => 12345,
	RNG_HME_5 => 12345,
	RNG_HME_6 => 12345,
	RNG_HME_SHIFT => 0,

	POLICY_EUCAP2003_YEAR => 2003,
	POLICY_EUCAP2003_BASEVALUE_ARABLE => 303,
	POLICY_EUCAP2003_BASEVALUE_GRASSLAND => 72,
	POLICY_EUCAP2003_SHARE_SETASIDE => 0.08,
	POLICY_EUCAP2003_MAX_NOSETASIDE => 26,
	POLICY_EUCAP2003_SUM_ARABLE => undef,
	POLICY_EUCAP2003_SUM_GRASSLAND  => undef,
	POLICY_EUCAP2003_SUM_FOR_TOPUP  => undef,

	#LMMINBIDREL
	#LMMINBIDABS
	#LMMAXBIDREL
	#LMMAXBIDABS
	#LMMKUPOUT
	#LMMKUPIN
	#LMTRYOUT
	#LMTRYIN
	#LMMAXDIST
	#LMDURATION
	#LMSHPAYEND
	#LMTRADING_ON

	LMNORENTOUT => 1,
	#LMLOOPS_RENTOUT
	LMSELLFORCASH => 0,
	#LMMAXPGSIZE
	LMPGDIAGONAL => 0,
	#LMMINPGSIZE
	#LMRESERVE_PRICE_COEFF
	#LMBID_MAXDIST
	#LMBID_MAXDIST_TO_PLOT
	#LMBID_PRICE_COEFF
	#LMBID_PROB_OTHERS
	#LMRENT_AUCTION_TOPUP
	COMTYPE		=>	2,
	CUMADOPT	=>	1,
	PAREX		=>	0.5,
	SAFEROUND	=>	1,
	MINPERM		=>	.1,
	OVERLAP		=>	0.8,
	EFFRAIN_TYPE	=>	USDA,
	EFFRAIN_CONST	=> 	1.3E+00,
	EFFRAIN_CWR	=>	-3.5E-02,
	EFFRAIN_CWR2	=>	1.7E-04,
	EFFRAIN_PREC	=>	6.4E-01,
	EFFRAIN_PREC2	=>	-4.8E-04,
	EFFRAIN_CWRPREC	=>	1.0E-03,

	MIGRATIONPULL => 0,
	TCOST => 0,
	
	
	LIVSIM_target_herd =>50000,
	LIVSIM_replacement_age_bulls	=> 8,
	LIVSIM_max_open	=> 3,
	LIVSIM_max_bulls => 1800,	
	LIVSIM_max_age_cows	=> 10 ,
	LIVSIM_max_lact => 6,
	
	SKIP_PERIODS_EXPECTATION_UPDATE => 0,
	SERIES_VARIATION_ONLY_MATCHING_YIELD_EXPECTATIONS => 0,
	SERIES_VARIATION_ONLY_MATCHING_PRICE_EXPECTATIONS => 0
);

our %mpmas_simrun_variation = (
    _PRICES_ => 1,
#    _INITIAL_PRICE_EXPECTATIONS_ => 1,
    _EXTERNAL_CG_YIELDS_ => 1,
    _EXTERNAL_CG_YIELD_EXPECTATIONS_ => 1
);

#Predefined activity types
# ### marks the place where user-defined types are inserted by mpmasql
our $ACTIVITY_TYPES = "MASsell, MASsellkind, MASbuy,MASfoodbuy, MASfoodconsume, MASlabpin, MASlabpout, MASlabtin, MASlabtout, MASdep, MASscred, MASscborrow, MASscdefault, MASrcash, 
none,
###, 
MASlivestock, MASlivestock_s0, MASlivestock_s1, MAScgact, MASperennial, MASswitch,MASdisinvest, MASnutdemand, MASnutsupply,  MASnutdeficit, MASxc_inc_func,MASxc_sav_func,MASxc_sav_seg0,MASxc_sav_seg2,MASxc_sav_seg3, MASxc_sav_bin1, MASxc_sav_bin2, MASxc_nf_exp, MASxc_fnf_func, MASxc_fnf_const, MASxc_fnf_hhsize, MASxc_fnf_seg1,MASxc_fnf_seg2,MASxc_fnf_seg3,MASxc_fnf_bin, MASxc_foo_func, MASxc_foo_const,MASxc_foo_hhsize, MASxc_foo_price, MASxc_foo_seg1, MASxc_foo_seg2, MASxc_foo_seg3, MASxc_foo_bin,MASxc_foo_cattrans, MAStppenalty, MASrentout, MASexit, MASxc_inc_trans, MASpenalty, MASnutpenalty, MASfuture, MASzero";
#Predefined constraint types
# ### marks the place where user-defined types are inserted by mpmasql
our $CONSTRAINT_TYPES = 	
"MASliq, MASlab, MASsoil, MASownsoil, MASwater1, MASwater2, MAScas, MASinv, MASly1, MASong, MASscl, MASliqend, MASscbal, MASscdef, MASperlab, MASpermac, MASperennial, MASlivestock,
none, 
###,
MAStppenalty, MASextra, MASnutdemand, MASnutsupply, MASnutbalance, MASnutdeficit, MASxc_inc_trans, MASxc_inc_func, MASxc_sav_trans, MASxc_sav_func,MASxc_sav_balance, MASxc_sav_lbound,MASxc_sav_ubound, MASxc_expbal, MASxc_fnf_func, MASxc_fnf_const, MASxc_fnf_hhsize, MASxc_fnf_tex, MASxc_fnf_lbound, MASxc_fnf_ubound, MASxc_foo_foodcat,MASxc_foo_const,MASxc_foo_hhsize,MASxc_foo_price, MASxc_foo_fexc, MASxc_foo_lbound, MASxc_foo_ubound,MASxc_foo_cattrans, MASzero, MASforget";

