All pastes #454008 Raw Edit

Something

public text v1 · immutable
·published 2007-04-23 10:49 UTC
rendered paste body
   if (msg.performative.equals("recommend-one")) {
     String item = msg.content ;
     if (communities.containsKey(msg.content)) {
       Vector agents = (Vector)communities.get(msg.content) ;
       String ragent = new String();
       int num = agents.size() ;
       int index;
       int aind = 0;
      
       
       	  if (msg.content == "Liquor")
       	  {
       	  	int first = Integer.parseInt((String)lprice.elementAt(0));
       	  	for(int i = 0; i< lprice.size(); i++)
       	  	{
       	  		int temp = Integer.parseInt((String)lprice.elementAt(i));
       	  		if(first > temp);
       	  		first = temp;
       	  		aind = i;
       	  		
       	  	}
       	  	
       	   ragent = (String)lname.elementAt(aind);
       	  } else
       	   if (msg.content == "Wine")
       	  {
       	  	int first = Integer.parseInt((String)wprice.elementAt(0));
       	  	for(int i = 0; i< wprice.size(); i++)
       	  	{
       	  		int temp = Integer.parseInt((String)wprice.elementAt(i));
       	  		if(first > temp);
       	  		first = temp;
       	  		aind  = i;
       	  		
       	  	}
       	  	 ragent = (String)wname.elementAt(aind);
       	  } else 
       	   if (msg.content == "Beer")
       	  {
       	  	int first = Integer.parseInt((String)bprice.elementAt(0));
       	  	for(int i = 0; i< bprice.size(); i++)
       	  	{
       	  		int temp = Integer.parseInt((String)bprice.elementAt(i));
       	  		if(first > temp);
       	  		first = temp;
       	  		aind = i;
       	  		
       	  	}
       	  	ragent = (String)bname.elementAt(aind);
       	  }
       	
       	
      
         
       
       
       msg.performative = "tell" ;
       msg.content = ragent ;