import uchicago.src.sim.engine.SimpleModel; import uchicago.src.sim.analysis.Plot; import java.util.ArrayList; import java.io.*; public class MarketModel extends SimpleModel { protected int numBuyers = 5; protected int numSellers = 5; protected int mTick = 50; protected int hMacro = 10; protected Time time; protected ArrayList buyers; protected ArrayList sellers; protected String outputFile = "standard.txt"; protected FileWriter file; /** * Constructor * initialize parameter and model names */ public MarketModel() { params = new String[]{"NumBuyers", "NumSellers", "OutputFile"}; name = "Virtual Market Model"; } /** * Called by SimpleModel.begin() (i.e. when clicking the initialize button) * Creates the agents and initializes them (calls initagents() ) */ public void buildModel() { int i; int id=0; time=new Time(mTick,hMacro); buyers=new ArrayList(); sellers=new ArrayList(); for (i=0; i