Skip to contents

Calendar objects describe the yearly succession of states and costs. They maybe be simple if an unique branch is possible, in which case prob is optional or probabilistic if at least two branches ar given, with correspondent prob information.

The function calendar() creates objects Calendar.

Usage

calendar(
  tree = NULL,
  prob = NULL,
  cost = NULL,
  state = NULL,
  exposition = NULL,
  project = NULL,
  action = NULL,
  horizon = NULL,
  base = NULL,
  change = NULL
)

Arguments

tree

See details.

prob

numeric, vector of probability. See details.

cost

numeric, matrix of cost (years as row).

state

numeric, matrix of probability to be each year (rows) in a given state (column).

exposition

list, list of by sectors of list of matrix of exposition calendars.

project

data.frame describing a set of projects.

action

data.frame describing a set of actions.

horizon

integer vector giving the time horizon (in years).

base

Calendar object used as base for probablistic calendar.

change

Calendar object used as possible change for probabilistic calendar.

Details

The behaviour of the function is changed depending on parameters that are given.

If a project is given, then both action and horizon must be given and calendar constructs the result through prepare_calendar_simple.

If a base is given, the both change and porb must be given and calendar constructs the result through prepare_calendar_probabilistic.

If tree is given as data.frame, then cost is constructed with column cost of tree (which may be NULL), the horizon is constructed with column year of tree (which should not be NULL), the other columns being interpreted as a tree after being transformed in a matrix.

If tree is a list, elements tree, prob, cost, and state are used to construct the object.

Finally, tree is used as is to construct the object. In this case it should be a matrix as expected from class Calendar.

Functions

  • calendar(): function to generate Calendar objects

Slots

tree

character matrix, giving possibles successions of states. Columns ar possible branches, rows are years.

prob

numerical vector, giving probability to be in each branch of tree.

cost

numerical matrix, giving calendar of cost. Rows are years.

state

numerical matrix of probability to be each year (rows) in a given state (column).

exposition

list, list of by sectors of list of matrix of exposition calendars.

Author

Frédéric Grelot, frederic.grelot.1994_cran@m4x.org