import java.io.*; import java.util.*; import java.util.LinkedList; import java.lang.*; class node { public int id; public int capability; public double pheromone; public int comm; public node (int id,int capability,double pheromone,int comm) { this.id=id; this.capability=capability; this.pheromone=pheromone; this.comm=comm; } public node() { this.id=0; this.capability=0; this.pheromone=0.0; this.comm=0; } public void get() { try { DataInputStream in = new DataInputStream(System.in); System.out.println("Enter the id and capability of the node :"); id=Integer.parseInt(in.readLine()); capability=Integer.parseInt(in.readLine()); System.out.println("Enter the pheromone value between current node and node"+id); pheromone=Double.parseDouble(in.readLine()); System.out.println("Enter the communication time between current node and node"+id); comm=Integer.parseInt(in.readLine()); } catch(Exception e) {} } public void show() { System.out.println("id = "+id+" Capability ="+capability+"\n"+"pheromone ="+pheromone+"communication time ="+comm); } } public class demo { public static void main(String args[])throws IOException { DataInputStream in = new DataInputStream(System.in); int adj_num=0; int capability; List nodelist = new LinkedList(); System.out.println("Enter the no. of adjacent nodes to current node"); adj_num=Integer.parseInt(in.readLine()); node[] node1= new node[adj_num]; for(int j=0;j