BCESolve
bcequilibrium.hpp
1// This file is part of the BCESolve library for games of incomplete
2// information
3// Copyright (C) 2022 Benjamin A. Brooks
4//
5// BCESolve free software: you can redistribute it and/or modify it
6// under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// BCESolve is distributed in the hope that it will be useful, but
11// WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13// General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see
17// <http://www.gnu.org/licenses/>.
18//
19// Benjamin A. Brooks
20// ben@benjaminbrooks.net
21// Chicago, IL
22
23#ifndef BCEQUILIBRIUM_HPP
24#define BCEQUILIBRIUM_HPP
25
26#include "bcecommon.hpp"
27#include "bceexception.hpp"
28#include <boost/serialization/list.hpp>
29#include <boost/serialization/vector.hpp>
30#include <boost/serialization/map.hpp>
31#include <boost/archive/text_iarchive.hpp>
32#include <boost/archive/text_oarchive.hpp>
33#include <boost/archive/binary_iarchive.hpp>
34#include <boost/archive/binary_oarchive.hpp>
35#include <boost/serialization/utility.hpp>
36
38
44{
45public:
47
50 map<int,double> distribution;
52 double key;
53
54public:
58
60 BCEquilibrium (const map<int,double> & data):
61 distribution(data), key(0.0)
62 {}
65
68 {
69 if (this!=&rhs)
70 {
71 this->distribution=rhs.distribution;
72 this->key=rhs.key;
73 }
74 return *this;
75 }
76
78 template <class Archive>
79 void serialize(Archive& ar, const unsigned int version)
80 {
81 ar & distribution & key;
82 }
83
84 friend class boost::serialization::access;
85 friend class BCEData;
86}; // BCEquilibrium
87
88
89#endif
Class for storing a BCE.
Definition: bcequilibrium.hpp:44
BCEquilibrium(const map< int, double > &data)
Constructor.
Definition: bcequilibrium.hpp:60
BCEquilibrium()
Default constructor.
Definition: bcequilibrium.hpp:56
void serialize(Archive &ar, const unsigned int version)
Serialization routine.
Definition: bcequilibrium.hpp:79
BCEquilibrium & operator=(const BCEquilibrium &rhs)
Assignment operator.
Definition: bcequilibrium.hpp:67
map< int, double > distribution
The BCE.
Definition: bcequilibrium.hpp:50
~BCEquilibrium()
Destructor.
Definition: bcequilibrium.hpp:64
double key
Unused key for sorting BCE.
Definition: bcequilibrium.hpp:52