creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Protected Attributes | List of all members
creativity::CopyrightPolice Class Reference

This class represents a copyright policing agent that (probabilistically) catches readers who obtain books via piracy, fining them and redistributing fines to infringed-upon authors. More...

#include <creativity/CopyrightPolice.hpp>

Public Member Functions

 CopyrightPolice ()=delete
 Not default constructible.
 
 CopyrightPolice (const Creativity &creativity)
 Constructor for a new CopyrightPolice agent. More...
 
void interApply () override
 When the period advances, we take the lump sum tax from all agents.
 
double interApplyPriority () const override
 Override priority to run after the Reader's interApply has deposited income.
 
void intraFinish () override
 When the period finishes, we probabilistically detect piracy; readers found pirating and fined, and the fines redistributed to the authors of the pirated works.
 
double tax () const
 Returns the lump sum per-reader tax collected each period.
 
double mu () const
 Returns the \(\mu\) parameter; the probability of being caught is the CDF of a \(\mathcal{N}(\mu, \sigma^2)\) distribution.
 
double sigma () const
 Returns the \(\sigma\) parameter; the probability of being caught is the CDF of a \(\mathcal{N}(\mu, \sigma^2)\) distribution.
 
double prob (unsigned pirated) const
 Returns the probability of being caught for a given number of pirated books. More...
 
double cost () const
 Returns the cost of being accused of piracy (whether guilty or not). More...
 
double fine (unsigned pirated)
 Returns the fine for being caught pirating pirated books this period. More...
 

Protected Attributes

const Creativitycreativity_
 The Creativity object that owns the simulation this reader belongs to.
 
double tax_
 The lump sum tax amount.
 
boost::math::normal normal_
 The normal distribution used to generate probabilities.
 

Detailed Description

This class represents a copyright policing agent that (probabilistically) catches readers who obtain books via piracy, fining them and redistributing fines to infringed-upon authors.

Constructor & Destructor Documentation

§ CopyrightPolice()

creativity::CopyrightPolice::CopyrightPolice ( const Creativity creativity)
explicit

Constructor for a new CopyrightPolice agent.

Takes a reference to the creativity object and the lump sum tax amount.

Exceptions
std::domain_errorif catch tax is negative, or if sigma is negative for the level of the catch tax.

Member Function Documentation

§ cost()

double creativity::CopyrightPolice::cost ( ) const
inline

Returns the cost of being accused of piracy (whether guilty or not).

This is simply a shortcut for creativity_.parameters.policy_catch_cost.

Unlike fine, this isn't a paid amount, but rather represents the opportunity cost to the user of being caught (as such it isn't really a CopyrightPolice property, but is provided here nonetheless for convenience).

§ fine()

double creativity::CopyrightPolice::fine ( unsigned  pirated)

Returns the fine for being caught pirating pirated books this period.

Will always return 0 for 0 pirated books, otherwise evaluates the creativity_.parameters.policy_catch_fine polynomial to determine the fine. Returns 0 if the polynomial evaluates to a negative number.

§ prob()

double creativity::CopyrightPolice::prob ( unsigned  pirated) const
inline

Returns the probability of being caught for a given number of pirated books.

This is simply the CDF of a normal distribution with parameters as given by mu() and sigma().

Inheritance diagram for creativity::CopyrightPolice:
[legend]
Collaboration diagram for creativity::CopyrightPolice:
[legend]

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