solve_efg
finds solutions of an extensive-form game
defined by extensive_form()
.
solve_efg(game, concept = "backward", quietly = FALSE)
An "extensive_form" class object created by
extensive_form()
.
Solution concept to be used. It must be one of
"backward"
(backward induction) or "spe"
(subgame perfect
equilibrium).
A logical value. If TRUE
, the solution(s) will not be
displayed on screen. Default is FALSE
.
A list containing (1) user-specified solution concept (either
backward induction or spe), (2) sols
: a list of solutions, if any,
(3) n_sols
: the number of solutions found, and (4) trees
: a
list of game trees each of which shows which paths were played under
each solution.
g1 <- extensive_form(
players = list("Kamijo",
rep("Yanai", 2),
rep(NA, 4)),
actions <- list(c("U", "D"),
c("U'", "D'"), c("U''", "D''")),
payoffs = list(Kamijo = c(0, 2, 1, 3),
Yanai = c(0, 1, 2, 1)))
s1 <- solve_efg(g1)
#> backward induction: [(U), (D', U'')]
g2 <- extensive_form(
players = list("f",
c("m", "m"),
rep(NA, 4)),
actions = list(c("ballet", "baseball"),
c("ballet", "baseball"), c("ballet", "baseball")),
payoffs = list(f = c(2, 0, 0, 1),
m = c(1, 0, 0, 2)),
show_node_id = FALSE)
s2 <- solve_efg(g2, quietly = TRUE)