# \donttest{
## the exogenous labor price with product as numeraire.
p.labor <- 0.625
dst.firm <- node_new("output",
type = "CD",
alpha = 1, beta = c(0.5, 0.5),
"land", "lab"
)
dst.landowner <- node_new(
"util",
type = "Leontief", a = 1,
"prod"
)
dst.laborer <- Clone(dst.landowner)
ge <- sdm2(
A = list(
dst.firm,
dst.landowner,
dst.laborer
),
B = diag(3),
S0Exg = matrix(c(
NA, NA, NA,
NA, 100, NA,
NA, NA, 100
), 3, 3, TRUE),
GRExg = 0,
names.commodity = c("prod", "land", "lab"),
names.agent = c("firm", "landowner", "laborer"),
maxIteration = 1,
numberOfPeriods = 200,
depreciationCoef = 0,
numeraire = "prod",
ts = TRUE,
policy = function(time, state, state.history) {
if (time > 1) {
ratio <- state$p[3] / state$p[1] / p.labor
last.labor.supply <- state.history$S[3, 3, time - 1]
state$S[3, 3] <- last.labor.supply * ratio
}
state
}
)
matplot(ge$ts.p, type = "l")
tail(ge$ts.S[3, 3, ])
plot(ge$ts.S[3, 3, ], type = "l")
# }
Run the code above in your browser using DataLab