import java.util.*;



/**
 * 输入数据
 * **/
public class Input {
	Random ra =new Random();
	static int server_num;
	
	//输入虚拟节点信息
	public  SeverList input_server()
	{
	    	int server_num;
	    	String host_name=null;
	    	int all_Memory=0;
	    	
	    	Scanner s =new Scanner(System.in);
	    	SeverList serverlist_head = new SeverList(host_name,all_Memory);
	    	SeverList serverlist_list = null;
	    	serverlist_list = serverlist_head;
	    	
	    	System.out.println("请输入虚拟服务器的台数：");
	    	server_num = s.nextInt();
	    	System.out.println("请输入每台虚拟服务器的基本情况");
	    	
	    	
	    	for(int i=0; i<server_num; i++)
	    	{
	    		
	    		//System.out.println("请输入第"+(i+1)+"台：");
	    		//System.out.println("请输入主机名：");
	    		//host_name = s.next();
	    		//System.out.println("请输入内存大小：");
	    		//all_Memory = s.nextInt();
	    		host_name = "host"+(i+1);
	    		all_Memory = ra.nextInt(4048);
	    		SeverList server_list = new SeverList(host_name,all_Memory);
	    		serverlist_list.add_SeverList(server_list);
	    		serverlist_list = serverlist_list.getNext();
	    	}
	    	return serverlist_head;
	
	}
	//输入任务信息
	public TaskList input_task()
	{
			 int task_num;
			 String taskName=null;
			 int need_Memory=0;
			 int time_ms=0;
			 
			 Scanner s =new Scanner(System.in);
			 TaskList tasklist_head = new TaskList(taskName,need_Memory,time_ms);
			 TaskList tasklist_list = tasklist_head;
			 
			 System.out.println("请输入虚拟任务的个数：");
			 task_num = s.nextInt();
	    	 System.out.println("请输入虚拟任务的基本情况");
	    	
	    	
	    	for(int i=0; i<task_num; i++)
	    	{
	    		
//	    		System.out.println("请输入第"+(i+1)+"个任务：");
//	    		System.out.println("请输入任务名：");
//	    		taskName = s.next();
//	    		System.out.println("请输入任务需要内存大小：");
//	    		need_Memory = s.nextInt();
//	    		System.out.println("请输入任务需要时间大小ms：");
//	    		time_ms = s.nextInt();
	    		taskName = "task"+(i+1);
	    		need_Memory = ra.nextInt(1094);
	    		time_ms = ra.nextInt(2000);
	    		TaskList tasklist = new TaskList(taskName,need_Memory,time_ms);
	    		tasklist_list.add_TaskList(tasklist);
	    		tasklist_list = tasklist_list.getNext();
	    	}
	    	
	    	 return tasklist_head;
	}
}
