Record Class NegotiationConfig

java.lang.Object
java.lang.Record
com.tnsai.coordination.negotiation.NegotiationConfig
Record Components:
type - negotiation protocol type
maxRounds - maximum negotiation rounds
timeout - negotiation timeout
reservationValue - minimum acceptable value (walk-away point)
initialOffer - starting offer value (-1 for auto)
concessionStrategy - strategy for making concessions

public record NegotiationConfig(com.tnsai.annotations.Coordination.NegotiationType type, int maxRounds, Duration timeout, double reservationValue, double initialOffer, ConcessionStrategy concessionStrategy) extends Record
Configuration for a negotiation session, typically extracted from @Coordination.Negotiation.
Since:
0.0.2
  • Constructor Details

    • NegotiationConfig

      public NegotiationConfig(com.tnsai.annotations.Coordination.NegotiationType type, int maxRounds, Duration timeout, double reservationValue, double initialOffer, ConcessionStrategy concessionStrategy)
      Creates an instance of a NegotiationConfig record class.
      Parameters:
      type - the value for the type record component
      maxRounds - the value for the maxRounds record component
      timeout - the value for the timeout record component
      reservationValue - the value for the reservationValue record component
      initialOffer - the value for the initialOffer record component
      concessionStrategy - the value for the concessionStrategy 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • type

      public com.tnsai.annotations.Coordination.NegotiationType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • maxRounds

      public int maxRounds()
      Returns the value of the maxRounds record component.
      Returns:
      the value of the maxRounds record component
    • timeout

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • reservationValue

      public double reservationValue()
      Returns the value of the reservationValue record component.
      Returns:
      the value of the reservationValue record component
    • initialOffer

      public double initialOffer()
      Returns the value of the initialOffer record component.
      Returns:
      the value of the initialOffer record component
    • concessionStrategy

      public ConcessionStrategy concessionStrategy()
      Returns the value of the concessionStrategy record component.
      Returns:
      the value of the concessionStrategy record component