import java.util.*;



public class main_program {
		public static  TreeMap<Long,Object> nodes = null;
		public static  UniformLoop uniloop =null;
		public static SeverList serverlist_head = null;
		public static TaskList tasklist_head =null;
		
	    
	    public static void main(String[] args) {
			  
	         Random ran = new Random();  
	         Input input = new Input();
	         uniloop = new UniformLoop();
	         AllocateTask allocatetask = null;
	        		 
	         
	         //一致环
	           
	         serverlist_head = input.input_server();
	         tasklist_head = input.input_task();
	         //打印虚拟服务器和任务信息
	         //serverlist_head.print_SeverList();
	         //tasklist_head.print_TaskList();
	        		 
	         //初始化一致环
	         uniloop.loopInit(serverlist_head);
	         nodes = uniloop.getHashnodes();
	         
	         //依据环和虚拟服务器的内存情况分配
	         allocatetask = new AllocateTask();
	         allocatetask.allocate_task(tasklist_head);
	        		 
	      
	        // System.out.println(hash_push.hash(hash_push.computeMd5(String.valueOf(i)),ran.nextInt(hash_push.VIRTUAL_NUM)));
	        //  System.out.println(hash_push.getShardInfo(hash_push.hash(hash_push.computeMd5(String.valueOf(i)),ran.nextInt(hash_push.VIRTUAL_NUM))));
	         
	   } 

	
}
