// Path: src/main/java/com/github/rinde/logistics/pdptw/mas/comm/AuctionCommModel.java
// public static class AuctionEvent extends Event {
//   private final Parcel parcel;
//   private final long auctionStartTime;
//   private final long time;
//   private final Optional<Bidder<?>> winner;
//   private final int receivedBids;
// 
//   AuctionEvent(Enum<?> type, Parcel p, Auctioneer a, long auctStart, long t) {
//     this(type, p, a, auctStart, t, -1);
//   }
// 
//   AuctionEvent(Enum<?> type, Parcel p, Auctioneer a, long auctStart, long t,
//       int numBids) {
//     super(type);
//     parcel = p;
//     auctionStartTime = auctStart;
//     time = t;
//     receivedBids = numBids;
//     if (type == EventType.FINISH_AUCTION) {
//       winner = Optional.<Bidder<?>>of(a.getWinner());
//     } else {
//       winner = Optional.absent();
//     }
//   }
// 
//   @Override
//   public String toString() {
//     return MoreObjects.toStringHelper(AuctionEvent.class)
//       .add("type", getEventType())
//       .add("parcel", parcel)
//       .add("winner", winner)
//       .add("time", time)
//       .toString();
//   }
// 
//   /**
//    * @return the parcel
//    */
//   public Parcel getParcel() {
//     return parcel;
//   }
// 
//   public int getNumBids() {
//     return receivedBids;
//   }
// 
//   public Optional<Bidder<?>> getWinner() {
//     return winner;
//   }
// 
//   public long getAuctionStartTime() {
//     return auctionStartTime;
//   }
// 
//   public long getTime() {
//     return time;
//   }
// }
// 
// Path: src/main/java/com/github/rinde/logistics/pdptw/mas/comm/AuctionCommModel.java
// public enum EventType {
// 
//   /**
//    * Event type indicating the start of an auction.
//    */
//   START_AUCTION,
// 
//   /**
//    * Event type indicating the end of an auction.
//    */
//   FINISH_AUCTION,
// 
//   /**
//    * Event type indicating the start of a reauction.
//    */
//   START_RE_AUCTION
// }


import java.util.LinkedHashMap;
import java.util.Map;
import javax.annotation.Nullable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.joda.time.Period;
import org.joda.time.format.PeriodFormatter;
import org.joda.time.format.PeriodFormatterBuilder;
import com.github.rinde.logistics.pdptw.mas.comm.AuctionCommModel.AuctionEvent;
import com.github.rinde.logistics.pdptw.mas.comm.AuctionCommModel.EventType;
import com.github.rinde.rinsim.core.model.DependencyProvider;
import com.github.rinde.rinsim.core.model.Model.AbstractModel;
import com.github.rinde.rinsim.core.model.ModelBuilder.AbstractModelBuilder;
import com.github.rinde.rinsim.core.model.pdp.Parcel;
import com.github.rinde.rinsim.event.Event;
import com.github.rinde.rinsim.event.Listener;
import com.github.rinde.rinsim.ui.renderers.PanelRenderer;
import com.google.auto.value.AutoValue;
import com.google.common.base.Optional;
              ae.getEventType().toString(),
              FORMATTER.print(new Period(0, ae.getTime())),
              finish
                ? ae.getWinner().get().toString() + SPACE + ae.getNumBids()
                : ""
            });

            if (collapseButton.get().getSelection()) {
              parent.setExpanded(!finish);
            }
            if (scrollButton.get().getSelection()) {
              final TreeItem target = parent.getExpanded() ? item : parent;
              tree.get().showItem(target);
              tree.get().select(target);
            }

            final int reauctions =
              model.getNumAuctions() - model.getNumParcels();
            final int perc =
              (int) ((reauctions - model.getNumUnsuccesfulAuctions()
                - model.getNumFailedAuctions()) / (double) reauctions
                * 100d);

            statusLabel.get().setText(
              "# parcels: " + model.getNumParcels()
                + " # ongoing auctions: " + model.getNumberOfOngoingAuctions()
                + " reauctions: " + reauctions
                + " (success: " + perc + "%)");

            statusLabel.get().setToolTipText(
// Path: src/main/java/com/github/rinde/logistics/pdptw/mas/comm/AuctionCommModel.java
// public static class AuctionEvent extends Event {
//   private final Parcel parcel;
//   private final long auctionStartTime;
//   private final long time;
//   private final Optional<Bidder<?>> winner;
//   private final int receivedBids;
// 
//   AuctionEvent(Enum<?> type, Parcel p, Auctioneer a, long auctStart, long t) {
//     this(type, p, a, auctStart, t, -1);
//   }
// 
//   AuctionEvent(Enum<?> type, Parcel p, Auctioneer a, long auctStart, long t,
//       int numBids) {
//     super(type);
//     parcel = p;
//     auctionStartTime = auctStart;
//     time = t;
//     receivedBids = numBids;
//     if (type == EventType.FINISH_AUCTION) {
//       winner = Optional.<Bidder<?>>of(a.getWinner());
//     } else {
//       winner = Optional.absent();
//     }
//   }
// 
//   @Override
//   public String toString() {
//     return MoreObjects.toStringHelper(AuctionEvent.class)
//       .add("type", getEventType())
//       .add("parcel", parcel)
//       .add("winner", winner)
//       .add("time", time)
//       .toString();
//   }
// 
//   /**
//    * @return the parcel
//    */
//   public Parcel getParcel() {
//     return parcel;
//   }
// 
//   public int getNumBids() {
//     return receivedBids;
//   }
// 
//   public Optional<Bidder<?>> getWinner() {
//     return winner;
//   }
// 
//   public long getAuctionStartTime() {
//     return auctionStartTime;
//   }
// 
//   public long getTime() {
//     return time;
//   }
// }
// 
// Path: src/main/java/com/github/rinde/logistics/pdptw/mas/comm/AuctionCommModel.java
// public enum EventType {
// 
//   /**
//    * Event type indicating the start of an auction.
//    */
//   START_AUCTION,
// 
//   /**
//    * Event type indicating the end of an auction.
//    */
//   FINISH_AUCTION,
// 
//   /**
//    * Event type indicating the start of a reauction.
//    */
//   START_RE_AUCTION
// }


// Path: src/main/java/com/github/rinde/logistics/pdptw/mas/comm/AuctionPanel.java
import java.util.LinkedHashMap;
import java.util.Map;
import javax.annotation.Nullable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.joda.time.Period;
import org.joda.time.format.PeriodFormatter;
import org.joda.time.format.PeriodFormatterBuilder;
import com.github.rinde.logistics.pdptw.mas.comm.AuctionCommModel.AuctionEvent;
import com.github.rinde.logistics.pdptw.mas.comm.AuctionCommModel.EventType;
import com.github.rinde.rinsim.core.model.DependencyProvider;
import com.github.rinde.rinsim.core.model.Model.AbstractModel;
import com.github.rinde.rinsim.core.model.ModelBuilder.AbstractModelBuilder;
import com.github.rinde.rinsim.core.model.pdp.Parcel;
import com.github.rinde.rinsim.event.Event;
import com.github.rinde.rinsim.event.Listener;
import com.github.rinde.rinsim.ui.renderers.PanelRenderer;
import com.google.auto.value.AutoValue;
import com.google.common.base.Optional;

              ae.getEventType().toString(),
              FORMATTER.print(new Period(0, ae.getTime())),
              finish
                ? ae.getWinner().get().toString() + SPACE + ae.getNumBids()
                : ""
            });

            if (collapseButton.get().getSelection()) {
              parent.setExpanded(!finish);
            }
            if (scrollButton.get().getSelection()) {
              final TreeItem target = parent.getExpanded() ? item : parent;
              tree.get().showItem(target);
              tree.get().select(target);
            }

            final int reauctions =
              model.getNumAuctions() - model.getNumParcels();
            final int perc =
              (int) ((reauctions - model.getNumUnsuccesfulAuctions()
                - model.getNumFailedAuctions()) / (double) reauctions
                * 100d);

            statusLabel.get().setText(
              "# parcels: " + model.getNumParcels()
                + " # ongoing auctions: " + model.getNumberOfOngoingAuctions()
                + " reauctions: " + reauctions
                + " (success: " + perc + "%)");

            statusLabel.get().setToolTipText(
              "unsuccessful: " + model.getNumUnsuccesfulAuctions()