Class Barter

java.lang.Object
org.episteme.social.economics.Barter
All Implemented Interfaces:
Serializable

public class Barter extends Object implements Serializable
Represents a direct exchange of property between two agents without using money. Atomic transaction that validates ownership before execution. * @version 1.1
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Barter

      public Barter(EconomicAgent agent1, Set<Resource> resources1, EconomicAgent agent2, Set<Resource> resources2)
      Initializes a barter contract.
      Parameters:
      agent1 - first participant
      resources1 - resources offered by agent1
      agent2 - second participant
      resources2 - resources offered by agent2
      Throws:
      IllegalArgumentException - if ownership is not verified
  • Method Details

    • getAgent1

      public EconomicAgent getAgent1()
    • getResources1

      public Set<Resource> getResources1()
    • getAgent2

      public EconomicAgent getAgent2()
    • getResources2

      public Set<Resource> getResources2()
    • execute

      public void execute()
      Executes the exchange, updating both agents' belongings.