Microsimulation API

Public Types | Public Member Functions | Public Attributes | List of all members
ssim::EventReport< State, Event, Time, Utility > Class Template Reference

EventReport class for collecting statistics on person-time, prevalence and numbers of events. More...

`#include <microsimulation.h>`

Collaboration diagram for ssim::EventReport< State, Event, Time, Utility >:
[legend]

## Public Types
typedef std::set< Time, std::greater< Time > > | Partition
typedef Partition::iterator | Iterator
typedef std::pair< State, Time > | Pair
typedef std::unordered_map< pair< State, Time >, int > | PrevMap
typedef std::unordered_map< pair< State, Time >, Utility > | UtilityMap
typedef std::unordered_map< pair< State, Time >, Time > | PtMap
typedef std::unordered_map< std::tuple< State, Event, Time >, int > | EventsMap
typedef vector< Utility > | IndividualUtilities

## Public Member Functions
| EventReport (Utility discountRate=0.0, bool outputUtilities=true, int size=1, Time startReportAge=Time(0), bool indiv=false)
void | resize (int size)
void | setPartition (const vector< Time > v)
void | setPartition (const Time start=0.0, const Time finish=100.0, const Time delta=1.0, const Time maxTime=Time(1.0e100))
void | setIndivN (const int n)
void | setStartReportAge (const Time a)
void | clear ()
void | individualReset ()
Utility | discountedUtilities (Time a, Time b, Utility utility=1.0)
void | addBrief (const Time lhs, const Time rhs, const Utility utility=1)
void | add (const State state, const Event event, const Time lhs, const Time rhs, const Utility utility=1, int index=0)
template<class T >
void | append_map (T &base_map, T &new_map)
void | append (EventReport< State, Event, Time, Utility > &er)
SEXP | wrap ()
SEXP | wrap_indiv ()
SEXP | wrap_means ()

## Public Attributes
Utility | discountRate
Utility | current
bool | outputUtilities
Partition | _partition
PrevMap | _prev
UtilityMap | _ut
PtMap | _pt
EventsMap | _events
IndividualUtilities | _vector
Means | mean_utilities
Time | startReportAge
int | id
bool | indiv

## Detailed Description

### template<class State, class Event, class Time = double, class Utility = double>
class ssim::EventReport< State, Event, Time, Utility >

EventReport class for collecting statistics on person-time, prevalence and numbers of events.

Definition at line 666 of file microsimulation.h.

## Member Typedef Documentation

## ◆ EventsMap

template<class State , class Event , class Time = double, class Utility = double>

typedef std::unordered_map<std::tuple<State,Event,Time>, int > ssim::EventReport< State, Event, Time, Utility >::EventsMap

Definition at line 674 of file microsimulation.h.

## ◆ IndividualUtilities

template<class State , class Event , class Time = double, class Utility = double>

typedef vector<Utility> ssim::EventReport< State, Event, Time, Utility >::IndividualUtilities

Definition at line 675 of file microsimulation.h.

## ◆ Iterator

template<class State , class Event , class Time = double, class Utility = double>

typedef Partition::iterator ssim::EventReport< State, Event, Time, Utility >::Iterator

Definition at line 669 of file microsimulation.h.

## ◆ Pair

template<class State , class Event , class Time = double, class Utility = double>

typedef std::pair<State,Time> ssim::EventReport< State, Event, Time, Utility >::Pair

Definition at line 670 of file microsimulation.h.

## ◆ Partition

template<class State , class Event , class Time = double, class Utility = double>

typedef std::set<Time, std::greater<Time> > ssim::EventReport< State, Event, Time, Utility >::Partition

Definition at line 668 of file microsimulation.h.

## ◆ PrevMap

template<class State , class Event , class Time = double, class Utility = double>

typedef std::unordered_map<pair<State,Time>, int > ssim::EventReport< State, Event, Time, Utility >::PrevMap

Definition at line 671 of file microsimulation.h.

## ◆ PtMap

template<class State , class Event , class Time = double, class Utility = double>

typedef std::unordered_map<pair<State,Time>, Time > ssim::EventReport< State, Event, Time, Utility >::PtMap

Definition at line 673 of file microsimulation.h.

## ◆ UtilityMap

template<class State , class Event , class Time = double, class Utility = double>

typedef std::unordered_map<pair<State,Time>, Utility > ssim::EventReport< State, Event, Time, Utility >::UtilityMap

Definition at line 672 of file microsimulation.h.

## Constructor & Destructor Documentation

## ◆ EventReport()

template<class State , class Event , class Time = double, class Utility = double>

ssim::EventReport< State, Event, Time, Utility >::EventReport | ( | Utility | discountRate = `0.0`,
|  | bool | outputUtilities = `true`,
|  | int | size = `1`,
|  | Time | startReportAge = `Time(0)`,
|  | bool | indiv = `false`
| ) |  |
| inline

Definition at line 676 of file microsimulation.h.

## Member Function Documentation

## ◆ add()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::add | ( | const State | state,
|  | const Event | event,
|  | const Time | lhs,
|  | const Time | rhs,
|  | const Utility | utility = `1`,
|  | int | index = `0`
| ) |  |
| inline

Definition at line 738 of file microsimulation.h.

## ◆ addBrief()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::addBrief | ( | const Time | lhs,
|  | const Time | rhs,
|  | const Utility | utility = `1`
| ) |  |
| inline

Definition at line 734 of file microsimulation.h.

## ◆ append()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::append | ( | EventReport< State, Event, Time, Utility > & | er | ) |
| inline

Definition at line 772 of file microsimulation.h.

## ◆ append_map()

template<class State , class Event , class Time = double, class Utility = double>
template<class T >

void ssim::EventReport< State, Event, Time, Utility >::append_map | ( | T & | base_map,
|  | T & | new_map
| ) |  |
| inline

Definition at line 767 of file microsimulation.h.

## ◆ clear()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::clear | ( |  | ) |
| inline

Definition at line 701 of file microsimulation.h.

## ◆ discountedUtilities()

template<class State , class Event , class Time = double, class Utility = double>

Utility ssim::EventReport< State, Event, Time, Utility >::discountedUtilities | ( | Time | a,
|  | Time | b,
|  | Utility | utility = `1.0`
| ) |  |
| inline

Definition at line 722 of file microsimulation.h.

## ◆ individualReset()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::individualReset | ( |  | ) |
| inline

Definition at line 710 of file microsimulation.h.

## ◆ resize()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::resize | ( | int | size | ) |
| inline

Definition at line 681 of file microsimulation.h.

## ◆ setIndivN()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::setIndivN | ( | const int | n | ) |
| inline

Definition at line 694 of file microsimulation.h.

## ◆ setPartition() [1/2]

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::setPartition | ( | const Time | start = `0.0`,
|  | const Time | finish = `100.0`,
|  | const Time | delta = `1.0`,
|  | const Time | maxTime = `Time(1.0e100)`
| ) |  |
| inline

Definition at line 687 of file microsimulation.h.

## ◆ setPartition() [2/2]

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::setPartition | ( | const vector< Time > | v | ) |
| inline

Definition at line 684 of file microsimulation.h.

## ◆ setStartReportAge()

template<class State , class Event , class Time = double, class Utility = double>

void ssim::EventReport< State, Event, Time, Utility >::setStartReportAge | ( | const Time | a | ) |
| inline

Definition at line 698 of file microsimulation.h.

## ◆ wrap()

template<class State , class Event , class Time = double, class Utility = double>

SEXP ssim::EventReport< State, Event, Time, Utility >::wrap | ( |  | ) |
| inline

Definition at line 779 of file microsimulation.h.

## ◆ wrap_indiv()

template<class State , class Event , class Time = double, class Utility = double>

SEXP ssim::EventReport< State, Event, Time, Utility >::wrap_indiv | ( |  | ) |
| inline

Definition at line 792 of file microsimulation.h.

## ◆ wrap_means()

template<class State , class Event , class Time = double, class Utility = double>

SEXP ssim::EventReport< State, Event, Time, Utility >::wrap_means | ( |  | ) |
| inline

Definition at line 795 of file microsimulation.h.

## Member Data Documentation

## ◆ _events

template<class State , class Event , class Time = double, class Utility = double>

EventsMap ssim::EventReport< State, Event, Time, Utility >::_events

Definition at line 804 of file microsimulation.h.

## ◆ _partition

template<class State , class Event , class Time = double, class Utility = double>

Partition ssim::EventReport< State, Event, Time, Utility >::_partition

Definition at line 800 of file microsimulation.h.

## ◆ _prev

template<class State , class Event , class Time = double, class Utility = double>

PrevMap ssim::EventReport< State, Event, Time, Utility >::_prev

Definition at line 801 of file microsimulation.h.

## ◆ _pt

template<class State , class Event , class Time = double, class Utility = double>

PtMap ssim::EventReport< State, Event, Time, Utility >::_pt

Definition at line 803 of file microsimulation.h.

## ◆ _ut

template<class State , class Event , class Time = double, class Utility = double>

UtilityMap ssim::EventReport< State, Event, Time, Utility >::_ut

Definition at line 802 of file microsimulation.h.

## ◆ _vector

template<class State , class Event , class Time = double, class Utility = double>

IndividualUtilities ssim::EventReport< State, Event, Time, Utility >::_vector

Definition at line 805 of file microsimulation.h.

## ◆ current

template<class State , class Event , class Time = double, class Utility = double>

Utility ssim::EventReport< State, Event, Time, Utility >::current

Definition at line 798 of file microsimulation.h.

## ◆ discountRate

template<class State , class Event , class Time = double, class Utility = double>

Utility ssim::EventReport< State, Event, Time, Utility >::discountRate

Definition at line 798 of file microsimulation.h.

## ◆ id

template<class State , class Event , class Time = double, class Utility = double>

int ssim::EventReport< State, Event, Time, Utility >::id

Definition at line 808 of file microsimulation.h.

## ◆ indiv

template<class State , class Event , class Time = double, class Utility = double>

bool ssim::EventReport< State, Event, Time, Utility >::indiv

Definition at line 809 of file microsimulation.h.

## ◆ mean_utilities

template<class State , class Event , class Time = double, class Utility = double>

Means ssim::EventReport< State, Event, Time, Utility >::mean_utilities

Definition at line 806 of file microsimulation.h.

## ◆ outputUtilities

template<class State , class Event , class Time = double, class Utility = double>

bool ssim::EventReport< State, Event, Time, Utility >::outputUtilities

Definition at line 799 of file microsimulation.h.

## ◆ startReportAge

template<class State , class Event , class Time = double, class Utility = double>

Time ssim::EventReport< State, Event, Time, Utility >::startReportAge

Definition at line 807 of file microsimulation.h.

The documentation for this class was generated from the following file:

- /home/marcle/src/R/microsimulation/inst/include/microsimulation.h