creativity  v1.3.0
Agent-based model of creativity and piracy
PublicTrackerMarket.hpp
1 #pragma once
2 #include <eris/Market.hpp>
3 #include <eris/Optimize.hpp>
4 #include "creativity/BookMarket.hpp"
5 
6 namespace creativity {
7 
8 class Book;
9 class Creativity;
10 
15 class PublicTrackerMarket : public BookMarket, public virtual eris::interopt::Advance {
16  public:
20  PublicTrackerMarket(const Creativity &creativity, eris::SharedMember<Book> b);
24  virtual void added() override;
28  virtual void interAdvance() override;
35  virtual void intraFinish() override;
36 
38  virtual bool isPublic() const override { return true; }
39 
40  protected:
42  void updatePrice();
43 };
44 
45 }
Primary namespace for all Creativity library code.
Definition: config.hpp:4
virtual void interAdvance() override
Updates the market price of the book to the minimum of unit_cost or piracy_cost (in case those change...
PublicTrackerMarket(const Creativity &creativity, eris::SharedMember< Book > b)
Constructs a PublicTrackerMarket that sells copies of the given Book at marginal cost of the lower of...
virtual void added() override
Sets the initial price and registers this as the book&#39;s market when added to the simulation.
This class extends BookMarket by always pricing the book at marginal cost (and thus never has any pro...
Definition: PublicTrackerMarket.hpp:15
Central class for a creativity simulation; this class handles setting up the simulation according to ...
Definition: Creativity.hpp:22
void updatePrice()
Resets price to the smaller of cost_unit and cost_piracy.
A BookMarket is very simple: it has an exogenously determined price and can supply infinite copies of...
Definition: BookMarket.hpp:14
virtual bool isPublic() const override
Returns true: this is a public market.
Definition: PublicTrackerMarket.hpp:38
virtual void intraFinish() override
Overrides BookMarket finish to just discard proceeds instead of transferring them to the author: sinc...