package hadi; public class Packet { private static final int D = 0; public int PAID;//* packet id */ public int PID;/* patient id */ public int SN_ID; /* sensor node id*/ public String SN_type;/* sensor node type */ public double SN_value; /* sensor node value */ //Constructor Packet public Packet(int PAID, int PID, int SN_ID, String SN_type, double SN_value) { this.PAID=PAID; this.PID=PID; this.SN_ID= SN_ID; this.SN_type=SN_type; this.SN_value=SN_value; } public void display() { System.out.println( "packet_id =" + this.PAID + " , patient_id = " + this.PID + " , sensor_node_id = " + this.SN_ID+ ",sensor_node_type : "+this.SN_type+ ",sensor_node_value : "+this.SN_value); } void init(int index) { int j; for (j=0;j<D;j++) { double r = ((double)Math.random()*32767 / ((double)32767+(double)(1)) ); tab[index][j]=r*(ub-lb)+lb; solution[j]=tab[index][j]; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)