Record Class GameTheoryEngine.NormalFormGame

java.lang.Object
java.lang.Record
org.episteme.social.economics.GameTheoryEngine.NormalFormGame
All Implemented Interfaces:
Serializable
Enclosing class:
GameTheoryEngine

public static record GameTheoryEngine.NormalFormGame(List<String> player1Strategies, List<String> player2Strategies, double[][] player1Payoffs, double[][] player2Payoffs) extends Record implements Serializable
Data model for a 2-player game in normal form.
Since:
1.0
Version:
1.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    NormalFormGame(List<String> player1Strategies, List<String> player2Strategies, double[][] player1Payoffs, double[][] player2Payoffs)
    Creates an instance of a NormalFormGame record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double[][]
    Returns the value of the player1Payoffs record component.
    Returns the value of the player1Strategies record component.
    double[][]
    Returns the value of the player2Payoffs record component.
    Returns the value of the player2Strategies record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NormalFormGame

      public NormalFormGame(List<String> player1Strategies, List<String> player2Strategies, double[][] player1Payoffs, double[][] player2Payoffs)
      Creates an instance of a NormalFormGame record class.
      Parameters:
      player1Strategies - the value for the player1Strategies record component
      player2Strategies - the value for the player2Strategies record component
      player1Payoffs - the value for the player1Payoffs record component
      player2Payoffs - the value for the player2Payoffs record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • player1Strategies

      public List<String> player1Strategies()
      Returns the value of the player1Strategies record component.
      Returns:
      the value of the player1Strategies record component
    • player2Strategies

      public List<String> player2Strategies()
      Returns the value of the player2Strategies record component.
      Returns:
      the value of the player2Strategies record component
    • player1Payoffs

      public double[][] player1Payoffs()
      Returns the value of the player1Payoffs record component.
      Returns:
      the value of the player1Payoffs record component
    • player2Payoffs

      public double[][] player2Payoffs()
      Returns the value of the player2Payoffs record component.
      Returns:
      the value of the player2Payoffs record component