harshitgupta1337 / fogsim

A Toolkit for Modeling and Simulation of Resource Management Techniques in Internet of Things, Edge and Fog Computing Environments
http://arxiv.org/abs/1606.02007
41 stars 37 forks source link

NullPointerException when running CleanFromJson example #2

Open lecomte opened 8 years ago

lecomte commented 8 years ago

When running the CleanFromJson example with any topology other than the routerTopology I get a NullPointer exception and I cannot figure out what is going on, since my topology has very similar characteristics to the router one. Such error also occurs if any other topology already included in the iFogSim package is used. Do you have any idea on why such thing could be happening?

Here is the output:

Starting VRGame... Sensor type : speed Sensor type : speed Sensor type : temperature Sensor type : temperature 0.0 Submitted application dcns_game java.lang.NullPointerException at org.fog.entities.Sensor.transmit(Sensor.java:88) at org.fog.entities.Sensor.processEvent(Sensor.java:136) at org.cloudbus.cloudsim.core.SimEntity.run(SimEntity.java:406) at org.cloudbus.cloudsim.core.CloudSim.runClockTick(CloudSim.java:518) at org.cloudbus.cloudsim.core.CloudSim.run(CloudSim.java:882) at org.cloudbus.cloudsim.core.CloudSim.startSimulation(CloudSim.java:188) at org.fog.examples.CleanFromJson.main(CleanFromJson.java:60)

The topology is as follows:

{
    "nodes": [{
        "level": 0,
        "upBw": 1024,
        "ratePerMips": 67.0,
        "name": "cloud",
        "type": "FOG_DEVICE",
        "mips": 1000,
        "ram": 4096,
        "downBw": 2048
    }, {
        "level": 1,
        "upBw": 1024,
        "ratePerMips": 55.0,
        "name": "gateway1",
        "type": "FOG_DEVICE",
        "mips": 1000,
        "ram": 1024,
        "downBw": 1024
    }, {
        "mean": 50.0,
        "sensorType": "speed",
        "name": "sensor3",
        "type": "SENSOR",
        "distribution": 1,
        "stdDev": 2.0
    }, {
        "level": 1,
        "upBw": 1024,
        "ratePerMips": 55.0,
        "name": "gateway2",
        "type": "FOG_DEVICE",
        "mips": 1000,
        "ram": 1024,
        "downBw": 1024
    }, {
        "mean": 60.0,
        "sensorType": "speed",
        "name": "sensor4",
        "type": "SENSOR",
        "distribution": 1,
        "stdDev": 3.5
    }, {
        "mean": 30.0,
        "sensorType": "temperature",
        "name": "sensor1",
        "type": "SENSOR",
        "distribution": 1,
        "stdDev": 2.5
    }, {
        "mean": 32.0,
        "sensorType": "temperature",
        "name": "sensor2",
        "type": "SENSOR",
        "distribution": 1,
        "stdDev": 1.0
    }],
    "links": [{
        "latency": 50.0,
        "destination": "cloud",
        "source": "gateway1"
    }, {
        "latency": 43.0,
        "destination": "gateway2",
        "source": "sensor3"
    }, {
        "latency": 60.0,
        "destination": "cloud",
        "source": "gateway2"
    }, {
        "latency": 78.0,
        "destination": "gateway2",
        "source": "sensor4"
    }, {
        "latency": 92.0,
        "destination": "gateway1",
        "source": "sensor1"
    }, {
        "latency": 87.0,
        "destination": "gateway1",
        "source": "sensor2"
    }]
}