creativity  v1.3.0
Agent-based model of creativity and piracy
PublicTracker.hpp
1 #pragma once
2 #include <eris/Agent.hpp>
3 #include <eris/Optimize.hpp>
4 #include "creativity/Creativity.hpp"
5 
6 namespace creativity {
7 
8 class Creativity;
9 
46 class PublicTracker : public eris::Agent,
47  public virtual eris::interopt::Apply, public virtual eris::intraopt::Finish {
48  public:
49  PublicTracker() = delete;
50 
57  explicit PublicTracker(const Creativity &creativity);
58 
62  void interApply() override;
63 
67  double interApplyPriority() const override { return 1.0; }
68 
70  void intraFinish() override;
71 
74 
77 
83  const double& dlPool() const;
84 
86  const double& votePool() const;
87 
88  protected:
91 
93  eris::Bundle dl_assets;
94 
96  eris::Bundle vote_assets;
97 
103  void distributeDLFunds();
104 
110  void distributeVoteFunds();
111 };
112 
113 }
This class represents a public provider of book copies that pays author based on the number of downlo...
Definition: PublicTracker.hpp:46
Primary namespace for all Creativity library code.
Definition: config.hpp:4
double policy_public_voting_tax
This is the lump-sum per-reader tax for public sharing with voting.
Definition: CreativitySettings.hpp:149
double voteTax() const
Returns the lump sum per-reader tax collected each period for vote-based compensation.
Definition: PublicTracker.hpp:76
const CreativitySettings & parameters
Simulation parameters that are used to configure the simulation when calling setup().
Definition: Creativity.hpp:36
const double & dlPool() const
Returns the current total asset pool that will be distributed to authors (proportional to downloads) ...
void distributeVoteFunds()
Awards all collected voting funds to authors in proportion to the number of votes received for their ...
void interApply() override
When the period advances, we take the lump sum tax from all agents, and create a public market for an...
const Creativity & creativity_
The Creativity object that owns the simulation this reader belongs to.
Definition: PublicTracker.hpp:90
double dlTax() const
Returns the lump sum per-reader tax collected each period for download count compensation.
Definition: PublicTracker.hpp:73
eris::Bundle vote_assets
Collected revenue for vote-count redistribution.
Definition: PublicTracker.hpp:96
Central class for a creativity simulation; this class handles setting up the simulation according to ...
Definition: Creativity.hpp:22
void intraFinish() override
When the period finishes, we return the lump sum tax proportionally to all authors.
PublicTracker()=delete
Not default constructible.
double interApplyPriority() const override
Override priority to run after the Reader&#39;s interApply has deposited income, and after readers have c...
Definition: PublicTracker.hpp:67
void distributeDLFunds()
Awards all collected download funds to authors in proportion to the number of public downloads of cop...
double policy_public_sharing_tax
This is the lump-sum tax extracted from each user at the beginning of the period to fund the public s...
Definition: CreativitySettings.hpp:144
const double & votePool() const
Like pool(), but for the voting version of the public tracker.
eris::Bundle dl_assets
Collected revenue for download-count redistribution.
Definition: PublicTracker.hpp:93