-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from MRC-CSO-SPHSU/develop
V0.3.2
- Loading branch information
Showing
9 changed files
with
173 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"[julia]": { | ||
"editor.detectIndentation": false, | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 4, | ||
"files.insertFinalNewline": true, | ||
"files.trimFinalNewlines": true, | ||
"files.trimTrailingWhitespace": true, | ||
"editor.rulers": [92], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,56 @@ | ||
""" | ||
Main simulation of the lone parent model | ||
Main simulation of the lone parent model | ||
Run this script from shell as | ||
Run this script from shell as | ||
# julia mainMA.jl | ||
from REPL execute it using | ||
from REPL execute it using | ||
> include("mainMA.jl") | ||
""" | ||
|
||
include("mainMAHelpers.jl") | ||
|
||
using MultiAgents: ABMSimulatorP | ||
using MultiAgents: run!, setup! | ||
using MultiAgents: run!, setup! | ||
using MALPM.Models: MAModel | ||
using SocioEconomics.Specification.Initialize: init! | ||
using MALPM.Examples | ||
|
||
const mainConfig = Light() # no input files, logging or flags (REPL Exec.) | ||
# mainConfig = WithInputFiles() | ||
const mainConfig = Light() # no input files, logging or flags (REPL Exec.) | ||
# const mainConfig = WithInputFiles() | ||
|
||
# lpmExample = LPMUKDemography() # don't remove deads | ||
lpmExample = LPMUKDemographyOpt() # remove deads | ||
lpmExample = LPMUKDemographyOpt() # remove deads | ||
|
||
const simPars, dataPars, pars = loadParameters(mainConfig) | ||
const simPars, dataPars, pars = load_parameters(mainConfig) | ||
|
||
# Most significant simulation and model parameters | ||
# Most significant simulation and model parameters | ||
# The following works only with Light() configuration | ||
# useful when executing from REPL | ||
if mainConfig == Light() | ||
if mainConfig == Light() | ||
simPars.seed = 0; seed!(simPars) | ||
simPars.verbose = false | ||
simPars.checkassumption = false | ||
simPars.verbose = false | ||
simPars.checkassumption = false | ||
simPars.sleeptime = 0 | ||
pars.poppars.initialPop = 5000 | ||
pars.poppars.initialPop = 28200 # 28100 for 1-min simulation | ||
end | ||
|
||
const model = setupModel(dataPars, pars) | ||
const logfile = setup_logging(simPars,mainConfig) | ||
|
||
const logfile = setupLogging(simPars,mainConfig) | ||
const data = load_demography_data(dataPars) | ||
|
||
const demoData = loadDemographyData(dataPars) | ||
const ukTowns, ukHouses, ukPop = create_uk_demography(pars,data) | ||
|
||
const ukDemography = MAModel(model,pars,demoData) | ||
const ukDemography = MAModel(ukTowns, ukHouses, ukPop, pars, data) | ||
|
||
const lpmDemographySim = | ||
init!(ukDemography) | ||
|
||
const lpmDemographySim = | ||
ABMSimulatorP{typeof(simPars)}(simPars,setupEnabled = false) | ||
setup!(lpmDemographySim,lpmExample) | ||
# Execution | ||
|
||
setup!(lpmDemographySim,lpmExample) | ||
|
||
# Execution | ||
@time run!(ukDemography,lpmDemographySim,lpmExample) | ||
|
||
closeLogfile(logfile,mainConfig) | ||
|
||
close_logfile(logfile,mainConfig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.