Git Product home page Git Product logo

Comments (6)

azeemjahangir avatar azeemjahangir commented on August 15, 2024

PDR, latency, etc graph in Cooja Simulator is calculated by java code see S-logix

from cooja.

azeemjahangir avatar azeemjahangir commented on August 15, 2024

How to calculate latency in ratio and pdr with energy consumption.

from cooja.

azeemjahangir avatar azeemjahangir commented on August 15, 2024

any one know

from cooja.

AfrinV avatar AfrinV commented on August 15, 2024

this code MIght be useful.

<script> TIMEOUT(900000, log.log(" Energy_consumption = " + energyconsumption + " (Joules) " + "\n" + " Delay = " + avgdelay + " (Sec) " + "\n" + " PDR = " + totalPRR + "\n")); packetsReceived= new Array(); packetsSent = new Array(); timeReceived = new Array(); timeSent = new Array(); delay = new Array(); serverID = 1; nodeCount = 16; totalPRR = 0; throughput = 0; datalength = 23; delayval=0.0; avgdelay=0.0; totalenergy = 0.0; energy_t =0.0; energy_consumption = 0.0; energyconsumption =0.0; e_count=0; for(i = 0; i < nodeCount; i++) { packetsReceived[i] = 0; packetsSent[i] = 0; timeSent[i] = 0; timeReceived[i]=0; delay[i]=0; } while(1) { YIELD(); msgArray=msg.split(' '); if(msgArray[0].equals("Sending")) { if(msgArray.length == 9) { senderID = parseInt(msgArray[9]); packetsReceived[senderID]++; timeReceived[senderID] = time; totalReceived = totalSent = 0; totaldelay = 0.0; count1 = 0; for(i = serverID + 1; i < nodeCount; i++) { totalReceived += packetsReceived[i]; totalSent += packetsSent[i]; if (timeReceived[i] > 0) { delayval = timeReceived[i] - timeSent[i]; delayval = delayval / 10000000; if (delayval > 0) { delay[i] = delay[i] + delayval; } } } for(i = serverID + 1; i < nodeCount; i++) { count1++; totaldelay = totaldelay + delay[i]; } avgdelay = totaldelay / count1; totalPRR = totalReceived / totalSent; } else if(msgArray.length == 6) { packetsSent[id]++; timeSent[id] = time; } } if(msgArray[0].equals("Energy")) { if(msgArray.length == 6) { e_count++; energy_t = parseInt(msgArray[5]); totalenergy = energy_t + totalenergy; energy_consumption = totalenergy / e_count; energyconsumption = energy_consumption / 1000; energyconsumption = energyconsumption / 128; } } }</script>

from cooja.

ceylanim avatar ceylanim commented on August 15, 2024

How to plot PDR, latency, etc graph in Cooja Simulator? now collect view is removed

Hi. Have you solved that?

from cooja.

cmrangan avatar cmrangan commented on August 15, 2024

hello any give or suggest packet delivery ratio source code using cooja simulator

from cooja.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.