Пример #1
0
 public SensorNode(bool TypeofNode,float range, int num, int speed )
 {
     //
     // TODO: Add constructor logic here
     //
     this.joinStatus=false;
     this.nodeDead=false;//the node is alive
     this.nodeType=TypeofNode;
     this.simulationSpeed=speed;
     this.children=0;
     this.iteration=0;
     // the node is in the receiving mode.
     this.nodeNum=num;
     this.xmissionRange=range;
     this.old_p_mac_x=-100;
     this.old_p_mac_y=-100;
     this.p_mac_x=40000;
     this.p_mac_y=40000;
     this.MessageCycles=0;
     this.totalBitsTransmitted=0;
     this.totalBitsReceived=0;
     this.childMacList=null;
     this.neighborReceivedXmitted=false;
     this.receivedApplicationMessages=null;
     this.receivedApplicationMessagesCount=0;
     if(TypeofNode==false)
     {
         this.img=ImageStream.FromFile("unDecidedNode.bmp");
         this.battery=new NodeBattery(0.5);
         this.hops=10000;
         this.nodeState=0;
         this.PowerOfThePath=0;
         this.nodeState=0;
     }
     else
     {
         this.img=ImageStream.FromFile("BaseStation.bmp");
         this.battery=new NodeBattery(10000);
         this.nodeState=1;
         this.hops=0;
         this.PowerOfThePath=this.battery.BATTERYPOWER;
         this.nodeState=1;
     }
 }
Пример #2
0
 public SensorNode(bool TypeofNode, float range, int num, int speed)
 {
     //
     // TODO: Add constructor logic here
     //
     this.joinStatus      = false;
     this.nodeDead        = false;   //the node is alive
     this.nodeType        = TypeofNode;
     this.simulationSpeed = speed;
     this.children        = 0;
     this.iteration       = 0;
     // the node is in the receiving mode.
     this.nodeNum                          = num;
     this.xmissionRange                    = range;
     this.old_p_mac_x                      = -100;
     this.old_p_mac_y                      = -100;
     this.p_mac_x                          = 40000;
     this.p_mac_y                          = 40000;
     this.MessageCycles                    = 0;
     this.totalBitsTransmitted             = 0;
     this.totalBitsReceived                = 0;
     this.childMacList                     = null;
     this.neighborReceivedXmitted          = false;
     this.receivedApplicationMessages      = null;
     this.receivedApplicationMessagesCount = 0;
     if (TypeofNode == false)
     {
         this.img            = ImageStream.FromFile("unDecidedNode.bmp");
         this.battery        = new NodeBattery(0.5);
         this.hops           = 10000;
         this.nodeState      = 0;
         this.PowerOfThePath = 0;
         this.nodeState      = 0;
     }
     else
     {
         this.img            = ImageStream.FromFile("BaseStation.bmp");
         this.battery        = new NodeBattery(10000);
         this.nodeState      = 1;
         this.hops           = 0;
         this.PowerOfThePath = this.battery.BATTERYPOWER;
         this.nodeState      = 1;
     }
 }