import java.util.*;



public class SeverList {
	 /**
     * 创建虚拟的服务器的链表
     * **/
	 private String host_name;
	 private int all_Memory;
	 
	 //剩余的内存
	 public  int rest_Memory;
	 public  int runing_num;
	 //分配的任务还需要多长时间运行
	 public  int rest_time_ms;
	 
	 private SeverList next;
	 
	 public SeverList(String host_name,int all_Memory)
	 { 
		 this.host_name = host_name;
		 this.all_Memory = all_Memory;
		 this.rest_Memory = this.all_Memory;
		 this.runing_num = 0;
		 this.next =null;
	 }
	 
	 public void  setNext(SeverList next)
	 {
		 this.next = next;
	 }
	 
	 public SeverList getNext()
	 {
		 return this.next;
	 }
	 
	 public String get_host_name()
	 {
		 return this.host_name;
	 }
	 
	 public int get_all_Memory()
	 {
		 return this.all_Memory;
	 }
	 //增加节点
	 public void add_SeverList(SeverList new_SeverList)
	 {
		 if(this.next == null)
		 {
			 this.next = new_SeverList;
		 }
		 else
		 {
			 this.next.add_SeverList(new_SeverList);
		 }
	 }
	 //打印节点
	 public void print_SeverList() {
		 
			System.out.println("hostname:"+this.host_name+",allmemory:"+this.all_Memory+",rest_memory:"+this.rest_Memory) ;
			
			if(this.next != null) {
				this.next.print_SeverList();
			}
		}
	 //打印单个节点
	 public void print_server()
	 {
		 System.out.println("hostname:"+this.host_name+",allmemory:"+this.all_Memory+",rest_memory:"+this.rest_Memory+"memory rate:" + (this.rest_Memory)/this.all_Memory) ; 
	 }

}
