Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ Collate:
'Individual.R'
'Household.R'
'Log.R'
'Market.R'
'MatchingMarket.R'
'MatchingMarketOptimal.R'
'MatchingMarketStochastic.R'
'Model.R'
'Network.R'
'Population.R'
'Pipeline.R'
'SearchStrategy.R'
'SelectStrategy.R'
'Transition.R'
'TransitionClassification.R'
'TransitionRegression.R'
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ export(Generic)
export(History)
export(Household)
export(Individual)
export(Market)
export(MatchingMarket)
export(MatchingMarketOptimal)
export(MatchingMarketStochastic)
export(Model)
export(Network)
export(Pipeline)
export(Population)
export(SearchStrategy)
export(SelectStrategy)
export(SupportedTransitionModels)
export(Transition)
export(TransitionClassification)
Expand Down
41 changes: 41 additions & 0 deletions R/Market.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#' Market class
#'
#' @description
#' A market class.
#'
#' @include Generic.R
#' @export
Market <- R6Class(
classname = "Market",
inherit = Generic,
public = list(
#' @description
#' Create a new market object.
#'
#' @param ... dots
#'
#' @return `NULL`
#'
#' @examples
#'
#' Mrkt <- Market$new()
initialize = function(...) {

},


#' @description
#' Match agents with choices
#'
#' @param agents a vector containing agent ids
#' @param choices a vector containing choice ids
#' @param probabilities a vector containing numerical probability values
#'
#' @return a [data.table::data.table] with two columns: `agent_id` and `choice_id`.
match = function(agents, choices, probabilities) {

}
),

private = list()
)
51 changes: 51 additions & 0 deletions R/SearchStrategy.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#' R6 Class Containing a search strategy for agents.
#'
#' @description
#' This is the base class for implementing a search strategy.
#'
#' @details
#' A search strategy to be adopted by agents when they are in a market.
#'
#' @include Generic.R
#' @export
SearchStrategy <- R6Class(
classname = "SearchStrategy",
inherit = dymiumCore::Generic,
public = list(

#' @description
#' Create a search strategy object.
#'
#' @param ... dots
#'
#' @return `NULL`
#' @export
#'
#' @examples
#'
#' SS <- SearchStrategy$new()
initialize = function(...){
self$set()
},

set = function() {
private$abstract()
},

simulate = function() {
private$abstract()
},

filter = function() {
private$abstract()
},

evaluate = function() {
private$abstract()
}
),

private = list(

)
)
39 changes: 39 additions & 0 deletions R/SelectStrategy.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#' R6 Class Containing a select strategy for agents.
#'
#' @description
#' This is the base class for implementing a select strategy.
#'
#' @details
#' A select strategy to be adopted by agents when they are in a market.
#'
#' @include Generic.R
#' @export
SelectStrategy <- R6Class(
classname = "SelectStrategy",
inherit = dymiumCore::Generic,
public = list(

#' @description
#' Create a select strategy object.
#'
#' @param ... dots
#'
#' @return `NULL`
#' @export
#'
#' @examples
#'
#' SS <- SearchStrategy$new()
initialize = function(...){

},

set = function() {

}
),

private = list(

)
)
110 changes: 110 additions & 0 deletions man/Market.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading