Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0602258
add a test for Population
asiripanich Aug 16, 2020
209b1bc
feat: support a choice data.frame in simulate_choice
asiripanich Sep 3, 2020
4591a53
feat: Population$household_type now returns more fields
asiripanich Sep 18, 2020
ff87b01
Generic gains an active `name` field
asiripanich Sep 18, 2020
02397e0
refactor codes
asiripanich Sep 18, 2020
12a139c
test: remove makeModel's predict test for now
asiripanich Sep 18, 2020
9d5dd3c
update error msg in World$add()
asiripanich Sep 18, 2020
f9f9ae3
update world$add()
asiripanich Sep 18, 2020
2f4e980
refactor: World
asiripanich Sep 18, 2020
40aecd5
test: update World
asiripanich Sep 18, 2020
fcfdac8
Merge remote-tracking branch 'origin/master' into dev
asiripanich Nov 2, 2020
2d4bf8b
test: run testthat unit tests in parallel with v3.0.0
asiripanich Nov 8, 2020
a383492
fix: replaced future_options with furrr_options
asiripanich Nov 8, 2020
e23de67
refactor: simulate_choice
asiripanich Nov 8, 2020
ef07fc2
feat(World): output a warning when add() replaces an existing object.
asiripanich Nov 8, 2020
9aa0d22
closed #77
asiripanich Nov 23, 2020
136fd75
removed all module-related files
asiripanich Nov 23, 2020
b648fce
removed all Building classes
asiripanich Nov 23, 2020
1728600
removed scenario-related files
asiripanich Nov 23, 2020
ef2e53b
removed Building from create_toy_world
asiripanich Nov 23, 2020
787b3d4
remove tests that required Building
asiripanich Nov 23, 2020
27dc331
removed event tests
asiripanich Nov 23, 2020
51a11ea
fix typo in test
asiripanich Nov 23, 2020
1241ac3
removed sim()
asiripanich Nov 23, 2020
a99fd59
renamed the pkg to dymium.core
asiripanich Nov 23, 2020
3fd3d9a
fix(Network): raise an informative error when dodgr is missing.
asiripanich Nov 29, 2020
4d4fb4f
enabled R6 documentation style of roxygen2
asiripanich Nov 29, 2020
230e6bf
removed the onLoad steps that create and show temp folders
asiripanich Nov 29, 2020
c55ad05
fixed ModelMultinomialLogit
asiripanich Nov 29, 2020
4adcf6f
added man-roxygen scripts for various common params
asiripanich Nov 29, 2020
0657f26
added a simpler World class.
asiripanich Nov 29, 2020
2216738
added a new WIP Entity class.
asiripanich Nov 29, 2020
53f2921
added ModelMultinomialLogit unit test
asiripanich Nov 29, 2020
f9ccc28
fixes World2 R6 methods and S3 methods
asiripanich Nov 30, 2020
ca68cc5
add World2 unit tests
asiripanich Nov 30, 2020
a268479
removed unnecessary double colons of self namespace
asiripanich Nov 30, 2020
4571b97
fix(DataBackendDataTable): converts data.frame object to data.table i…
asiripanich Nov 30, 2020
0964320
added drafts
asiripanich Dec 1, 2020
1933bd7
added some tidymodels pkgs to suggests
asiripanich Dec 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: dymiumCore
Package: dymium.core
Version: 0.1.9.9000
Title: A Toolkit for Building a Dynamic Microsimulation Model for Integrated Urban Modelling
Description: A modular microsimulation modelling framework for integrated urban modelling.
Expand All @@ -18,7 +18,6 @@ Imports:
R6 (>= 2.3.0),
data.table (>= 1.13.0),
checkmate (>= 1.9.4),
matchingR (>= 1.3.0),
magrittr,
purrr (>= 0.3.0),
lgr (>= 0.3.3),
Expand All @@ -31,8 +30,9 @@ Imports:
rlang (>= 0.4.0),
tryCatchLog (>= 1.1.0)
Suggests:
matchingR (>= 1.3.0),
furrr (>= 0.1.0),
testthat (>= 2.1.0),
testthat (>= 3.0.0),
fastmatch (>= 1.1.0),
mlogit (>= 1.1.0),
caret (>= 6.0.0),
Expand All @@ -52,8 +52,11 @@ Suggests:
scales (>= 1.1.0),
prettydoc,
visNetwork (>= 2.0.0),
dfidx
Roxygen: list(markdown = TRUE, r6 = FALSE)
dfidx,
parsnip,
ranger,
glmnet
Roxygen: list(markdown = TRUE, r6 = TRUE)
RoxygenNote: 7.1.1
StagedInstall: no
VignetteBuilder: knitr
Expand All @@ -62,10 +65,6 @@ Collate:
'Entity.R'
'Agent.R'
'Asset.R'
'Building.R'
'BuildingCommercial.R'
'BuildingIndustrial.R'
'BuildingResidential.R'
'ContainerGeneric.R'
'Container.R'
'DataBackend.R'
Expand Down Expand Up @@ -103,18 +102,16 @@ Collate:
'data.R'
'dymiumCore-package.R'
'makeModel.R'
'module.R'
'mutate-entity.R'
'population-register.R'
'scenario.R'
'sim.R'
'simulate_choice.R'
'transition-fnc.R'
'usethis.R'
'utils-class.R'
'utils-event.R'
'utils-pipe.R'
'utils-pipeline.R'
'utils.R'
'validate.R'
'zzz.R'
Config/testthat/parallel: true
Config/testthat/edition: 3
21 changes: 1 addition & 20 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ S3method(predict,ModelMultinomialLogit)
S3method(simulate_choice,Model)
S3method(simulate_choice,WrappedModel)
S3method(simulate_choice,data.frame)
S3method(simulate_choice,dymium.choice_table)
S3method(simulate_choice,glm)
S3method(simulate_choice,list)
S3method(simulate_choice,train)
Expand All @@ -27,10 +28,6 @@ export("%>%")
export(.get_sim_time)
export(Agent)
export(Asset)
export(Building)
export(BuildingCommercial)
export(BuildingIndustrial)
export(BuildingResidential)
export(Container)
export(ContainerGeneric)
export(DataBackend)
Expand Down Expand Up @@ -72,19 +69,15 @@ export(assert_target)
export(assert_transition_supported_model)
export(check_entity)
export(check_entity_ids)
export(check_module)
export(check_module_version)
export(check_required_models)
export(check_subset2)
export(check_target)
export(check_transition_supported_model)
export(combine_histories)
export(create_scenario)
export(create_toy_population)
export(create_toy_world)
export(dm_get_model)
export(dm_save)
export(download_module)
export(dsample)
export(element_wise_expand_lists)
export(expect_entity)
Expand All @@ -94,14 +87,9 @@ export(expect_subset2)
export(expect_target)
export(expect_transition_supported_model)
export(extract_data)
export(get_active_scenario)
export(get_all_module_files)
export(get_history)
export(get_log)
export(get_models)
export(get_module_files)
export(get_module_versions)
export(get_modules)
export(get_sim_time)
export(get_supported_models)
export(get_transition)
Expand All @@ -121,8 +109,6 @@ export(pop_register)
export(register)
export(remove_entity)
export(sample_choice)
export(set_active_scenario)
export(sim)
export(simulate_choice)
export(test_entity)
export(test_entity_ids)
Expand All @@ -132,9 +118,6 @@ export(test_target)
export(test_transition_supported_model)
export(transition)
export(unnest_dt)
export(use_event)
export(use_module)
export(use_module_readme)
export(validate_linkages)
export(which_max_n)
export(which_min_n)
Expand All @@ -161,8 +144,6 @@ importFrom(magrittr,"%>%")
importFrom(magrittr,freduce)
importFrom(magrittr,functions)
importFrom(magrittr,set_colnames)
importFrom(matchingR,galeShapley.collegeAdmissions)
importFrom(matchingR,galeShapley.marriageMarket)
importFrom(purrr,flatten_int)
importFrom(purrr,map)
importFrom(purrr,map2)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
## New features

- `ModelMultinomialLogit` and `ModelBinaryChoice` now have S3 `predict` and `summary` methods. Note that `ModelMultinomialLogit` requires `newdata` to be in the same format that is required by `mlogit`.
- `Population$household_type()` now returns the number of members in household and remove individuals not belong to any household.
- When calling `World$add()` and `name` is missing, it will see if the object has a `name` field, if it is a `Target` or a `Model`.

## Changes

- closed #57
- add a `name` argument to `Model`'s constructor function and expose it as an R6 active field.
- `World$add()` can now be used to add a named `Model` without providing the `name` argument.
- `World$add()` gained a `replace` argument with `TRUE` as its default value.
- `Generic` now has an active `name` field which will equal to `NULL` if no name is given.

## Bug fixes

Expand Down
53 changes: 0 additions & 53 deletions R/Building.R

This file was deleted.

42 changes: 0 additions & 42 deletions R/BuildingCommercial.R

This file was deleted.

39 changes: 0 additions & 39 deletions R/BuildingIndustrial.R

This file was deleted.

45 changes: 0 additions & 45 deletions R/BuildingResidential.R

This file was deleted.

10 changes: 5 additions & 5 deletions R/Container.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#'
#' @usage NULL
#' @format [R6::R6Class] object inheriting from [dymiumCore::ContainerGeneric]
#' @format [R6::R6Class] object inheriting from [ContainerGeneric]
#' @include ContainerGeneric.R
#'
#' @section Construction:
Expand All @@ -25,8 +25,8 @@
#'
#' * `add(x, name)`\cr
#' ([R6::R6Class]|Supported Transition Models)\cr
#' Add an [R6::R6Class] object or a object of the classes in [dymiumCore::SupportedTransitionModels] to self$Cont.
#' Name must be given when `x` is an object of the classes in [dymiumCore::SupportedTransitionModels].
#' Add an [R6::R6Class] object or a object of the classes in [SupportedTransitionModels] to self$Cont.
#' Name must be given when `x` is an object of the classes in [SupportedTransitionModels].
#'
#' * `check_pos(x)`\cr
#' (`integer(1)`) -> (`logical(1)`)\cr
Expand All @@ -52,7 +52,7 @@
#' generator or string or integer.
#'
#' * `unpack(target)`\cr
#' ([dymiumCore::Container])\cr
#' ([Container])\cr
#' Add all the references inside self$Cont to the `target` container. This is
#' useful when you have containers within a container so that all references can
#' be access via the top container. eg: A World container that contains a Population
Expand All @@ -66,7 +66,7 @@
#' @export
Container <- R6Class(
classname = "Container",
inherit = dymiumCore::ContainerGeneric,
inherit = ContainerGeneric,
public = list(

add = function(x, name) {
Expand Down
Loading