|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.princeton.repeatedgames.rgsolve.games.Game
edu.princeton.repeatedgames.rgsolve.games.ScaledGame
public class ScaledGame
This class scales the payoffs of a Game
object
linearly, according to the function
newPayoff(player) = payoff(player) * slope[player] + offset[player]
Field Summary | |
---|---|
Game |
game
The base game |
private double[] |
offset
intercept of payoff scaling |
private static long |
serialVersionUID
Serialization ID |
private double[] |
slope
slope of payoff scaling |
Fields inherited from class edu.princeton.repeatedgames.rgsolve.games.Game |
---|
description, extension |
Constructor Summary | |
---|---|
ScaledGame(Game game)
|
|
ScaledGame(Game game,
double[] slope,
double[] offset)
|
Method Summary | |
---|---|
static ScaledGame |
getNormalizedGame(Game game,
double min,
double max)
Normalizes the range of payoffs to each player to the range [min, max] |
static ScaledGame |
getOffsetGame(Game game,
double[] offset)
Offsets the payoffs to each player by the amount offset[player] |
double |
payoff1(int a1,
int a2)
payoff to player 1 |
double |
payoff2(int a1,
int a2)
payoff to player 2 |
void |
setOffset(double[] offset)
Offsets this game by offset |
Methods inherited from class edu.princeton.repeatedgames.rgsolve.games.Game |
---|
actionUsable, copyUsableActions, delta, m, m1, m2, payoff, payoff, setActionUsable, setDescription, setDiscount, usableActionsDefined |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public Game game
private double[] slope
private double[] offset
Constructor Detail |
---|
public ScaledGame(Game game)
public ScaledGame(Game game, double[] slope, double[] offset)
Method Detail |
---|
public void setOffset(double[] offset)
offset
offset
- a 2-array of offsets for each playerpublic static ScaledGame getNormalizedGame(Game game, double min, double max)
[min, max]
game
- a Gamemin
- max
-
public static ScaledGame getOffsetGame(Game game, double[] offset)
offset[player]
game
- a Gameoffset
- a 2-array of offsets for each player
public double payoff1(int a1, int a2)
Game
payoff1
in class Game
a1
- player 1 actiona2
- player 2 action
public double payoff2(int a1, int a2)
Game
payoff2
in class Game
a1
- player 1 actiona2
- player 2 action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |