public static void main(String[] args) throws IOException {
boolean running = true;
AgentConfig agentConfig = AgentConfigBuilder.buildAgentConfig(args[0]);
AuctionAgent auctionAgent = new AuctionAgentImpl(agentConfig);
auctionAgent.start();
int id = agentConfig.getId();
String cmd;
Scanner scan = new Scanner(System.in);
while(running)
{
System.out.print("Agent " + id +" Started");
cmd = scan.nextLine().toLowerCase();
if (cmd.equals("exit"))
{
running = false;
}else if (cmd.equals("status")){
System.out.println(auctionAgent);
}else{
System.out.println("Type \"exit\" to stop the agent");
System.out.println("Type \"status\" to agent's status");
}
}
auctionAgent.stop();
//Terminated
System.out.println("Agent " +id + " Terminated");
System.out.println("Final Stats");
System.out.println(auctionAgent);