Пример #1
0
  /**
   * This is called onyl if the GUI is on, and only to show the trade on the network
   *
   * @param sender the agent giving up the goods
   * @param receiver the agent receiving the goods
   * @param g what kind of good?
   * @param quantity how much is exchanged?
   */
  private void registerTradeOnNetwork(
      EconomicAgent sender, EconomicAgent receiver, GoodType g, int quantity) {
    // if graphing is not active, don't bother
    assert MacroII.hasGUI();

    assert network.containsAgent(sender);
    assert network.containsAgent(receiver);

    // if both are registered
    network.registerInventoryDelivery(sender, receiver, g, quantity);
  }