-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.jl
51 lines (35 loc) · 1.29 KB
/
structs.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
abstract type AbstractQPDM <: ContinuousUnivariateDistribution end
"""
QPDM{T<:Real} <: AbstractQPDM
A model object for the Quantum Prisoner's Dilemma Model. The QPDM has four basis states:
1. opponent defects and you defect
2. opponent defects and you cooperate
3. opponent cooperates and you defect
4. opponent cooperates and you cooperate
The bases are orthonormal and in standard form. The model assumes three conditions:
1. Player 2 is told that player 1 defected
2. Player 2 is told that player 1 cooperated
3. Player 2 is not informed of the action of player 1
Model inputs and outputs are assumed to be in the order above.
# Fields
- `μd`: utility for defecting
- `μc`: utility for cooperating
- `γ`: entanglement parameter for beliefs and actions
# Example
```julia
using QuantumPrisonersDilemmaModel
model = QPDM(;μd=.51, γ=2.09)
```
# References
Pothos, E. M., & Busemeyer, J. R. (2009). A quantum probability explanation for violations of ‘rational’decision theory. Proceedings of the Royal Society B: Biological Sciences, 276(1665), 2171-2178.
"""
struct QPDM{T<:Real} <: AbstractQPDM
μd::T
μc::T
γ::T
end
QPDM(;μd, μc=μd, γ) = QPDM(μd, μc, γ)
function QPDM(μd, μc, γ)
μd, μc, γ = promote(μd, μc, γ)
return QPDM(μd, μc, γ)
end