creativity
v1.3.0
Agent-based model of creativity and piracy
|
Records the various variables associated with a book. More...
#include <creativity/state/BookState.hpp>
Public Member Functions | |
BookState (const eris::SharedMember< Book > &b) | |
Constructs a new BookState, setting its values using the given Book member. | |
BookState (const Book &b) | |
Constructs a new BookState, setting its value using the given Book reference. | |
BookState (const unsigned int dimensions) | |
Constructs a new blank BookState for a book with a position of the given number of dimensions. More... | |
bool | market_any () const |
Returns true if this book was on either the private or public market this period, false if not. More... | |
bool | market_public () const |
Returns true if this book is on the public market this period. | |
uint32_t | sales_lifetime () const |
Returns the cumulative lifetime sales of this book, up to and including the current period, of both private and public markets. | |
uint32_t | copies () const |
Returns the number of new copies created in the current period. More... | |
uint32_t | copies_lifetime () const |
Returns the cumulative lifetime copies of the book, up to and including the current period. More... | |
Public Attributes | |
eris::eris_id_t | id |
Unique simulation ID of the book. | |
eris::eris_id_t | author |
The author of this book. | |
eris::Position | position |
Position of the book. | |
double | quality |
The quality parameter of this book, which is the mean of reader quality draws. | |
bool | market_private |
True if this book is on the private market, false if on the public market or not on the market at all. | |
double | price |
The market price of this book; will be NaN if this book was not on the market. | |
double | revenue |
The private market revenue of this book this period. | |
double | revenue_lifetime |
The cumulative lifetime private market revenue of this book, up to and including the current period. | |
double | prize |
The public/prize money received by the book's author this period for this book. | |
double | prize_lifetime |
The lifetime public/prize money received by the book's author for this book. | |
uint32_t | sales |
The number of sales of copies of this book in the current period. More... | |
uint32_t | sales_lifetime_private |
The cumulative lifetime private market sales of this book, up to and including the current period. | |
uint32_t | sales_lifetime_public |
The cumulative lifetime public market sales of this book, up to and including the current period. | |
uint32_t | pirated |
The number of pirated copies of this book in the current period. | |
uint32_t | pirated_lifetime |
The cumulative lifetime pirated copies of the book, up to and including the current period. | |
eris::eris_time_t | created |
The period in which this book ws created. Directly related to age. | |
uint32_t | lifetime_private |
The number of periods this book was (or has been) on the private market. More... | |
uint32_t | votes |
The number of votes the book received this period. | |
uint32_t | votes_lifetime |
The lifetime number of votes the book has received. | |
Records the various variables associated with a book.
This is basically a container class with a constructor that copies the current state of a given Book.
|
explicit |
Constructs a new blank BookState for a book with a position of the given number of dimensions.
All values will be default initialized. (The number of dimensions is needed for Position initialization).
|
inline |
Returns the number of new copies created in the current period.
This is simply sales + pirated
.
|
inline |
Returns the cumulative lifetime copies of the book, up to and including the current period.
This is simply sales_lifetime_private + sales_lifetime_public + pirated_lifetime
.
|
inline |
Returns true if this book was on either the private or public market this period, false if not.
The is determined directly from the price: a NaN price indicates a non-market status.
uint32_t creativity::state::BookState::lifetime_private |
The number of periods this book was (or has been) on the private market.
If this book is currently on the private market, this is simply the age plus 1; if not on the market, this is the number of periods that the book was on the market.
uint32_t creativity::state::BookState::sales |
The number of sales of copies of this book in the current period.
The sales are private sales if .market_private
is true and public sales if .market_public()
is true.