acsicuib / YAFS

Yet Another Fog Simulator (YAFS)
MIT License
98 stars 72 forks source link

Some sample cannot run (Tutorial & VRGameFog-IFogSim-WL is OK) #31

Closed ghost closed 4 years ago

ghost commented 4 years ago

export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/ConquestService/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh /home/rp/YAFS/src PATH EXPERIMENTO: exp1/ 2020-02-26 16:18:42,344 - root - INFO - Running Conquest - exp1/ Traceback (most recent call last): File "examples/ConquestService/main.py", line 252, in main(simulated_time=timeSimulation, path=pathExperimento, pathResults=dname, case='CQ',it=i) File "examples/ConquestService/main.py", line 116, in main dataNetwork = json.load(open(path + 'networkDefinition.json')) IOError: [Errno 2] No such file or directory: 'exp1/networkDefinition.json'


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/DynamicAllocation/main.py & export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/DynamicFailuresOnNodes/main.py & export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/DynamicWorkload/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh Traceback (most recent call last): File "examples/DynamicAllocation/main.py", line 145, in main(simulated_time=12000) File "examples/DynamicAllocation/main.py", line 56, in main t.G = nx.read_graphml("Euclidean.graphml") File "</home/rp/anaconda2/envs/yafs/lib/python2.7/site-packages/decorator.pyc:decorator-gen-622>", line 2, in read_graphml File "/home/rp/anaconda2/envs/yafs/lib/python2.7/site-packages/networkx/utils/decorators.py", line 214, in _open_file fobj = _dispatch_dict[ext](path, mode=mode) IOError: [Errno 2] No such file or directory: 'Euclidean.graphml'


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/FogCentrality/experiment2.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh sys:1: FutureWarning: The load_graphml function is deprecated and will be removed in version 2.0.0. Use NX.READ_GRAPHML function instead. Some error??


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/FogTorchPI-Integration/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh Traceback (most recent call last): File "examples/FogTorchPI-Integration/main.py", line 233, in main(simulated_time=100000) File "examples/FogTorchPI-Integration/main.py", line 112, in main data = json.load(open('egg_infrastructure.json')) IOError: [Errno 2] No such file or directory: 'egg_infrastructure.json'


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/MapReduceModel/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh f100n200 Running Replica Traceback (most recent call last): File "examples/MapReduceModel/main.py", line 280, in main(simulated_time=duration, experimento=pathExperimento, file=file, study=study,it=i) File "examples/MapReduceModel/main.py", line 121, in main dataNetwork = json.load(open(experimento+file+'-network.json')) IOError: [Errno 2] No such file or directory: 'f100n200-network.json'


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/MCDA/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh Traceback (most recent call last): File "examples/MCDA/main.py", line 26, in from WAPathSelectionNPlacement import WARoutingAndDeploying File "/home/rp/YAFS/src/examples/MCDA/WAPathSelectionNPlacement.py", line 14, in from sklearn import preprocessing ImportError: No module named sklearn

---------> (yafs) rp@ubuntu:~/YAFS/src$ conda install scikit-learn

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh /home/rp/YAFS/src PATH EXPERIMENTO: exp1/ 2020-02-26 16:30:55,089 - root - INFO - Running MCDA - ELECTRE - exp1/ Traceback (most recent call last): File "examples/MCDA/main.py", line 307, in main(simulated_time=timeSimulation, path=pathExperimento, pathResults=dname, case='MCDA', failuresON=False, it=i,idcloud = 153) File "examples/MCDA/main.py", line 128, in main dataNetwork = json.load(open(path + 'networkDefinition.json')) IOError: [Errno 2] No such file or directory: 'exp1/networkDefinition.json'


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/mobileTutorial/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh /home/rp/YAFS/src Experiment Path exp/ 2020-02-26 16:31:51,492 - root - INFO - Loading trajectories from (raw files): exp/trajectories/ Traceback (most recent call last): File "examples/mobileTutorial/main.py", line 327, in tracks = trackanimation.read_track(input_directory) File "/home/rp/YAFS/src/trackanimation/init.py", line 45, in read_track raise TrackException('Must specify a valid file name', directory_or_file) TrackException: Must specify a valid file name: exp/trajectories/


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/PartitionILPPlacement/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh /home/rp/YAFS/src Running Partition Traceback (most recent call last): File "examples/PartitionILPPlacement/main.py", line 221, in main(simulated_time=1000000, experimento=pathExperimento,ilpPath='',it=i) File "examples/PartitionILPPlacement/main.py", line 112, in main dataNetwork = json.load(open(experimento+'networkDefinition.json')) IOError: [Errno 2] No such file or directory: 'exp_rev/networkDefinition.json'


export PYTHONPATH=$PYTHONPATH:src/:examples/ python examples/Tutorial_JSONModelling/main.py

(yafs) rp@ubuntu:~/YAFS/src$ ./run.sh Running Partition Traceback (most recent call last): File "examples/Tutorial_JSONModelling/main.py", line 187, in main(simulated_time=100000, experimento=pathExperimento,ilpPath='') File "examples/Tutorial_JSONModelling/main.py", line 110, in main dataNetwork = json.load(open(experimento+'networkDefinition.json')) IOError: [Errno 2] No such file or directory: 'case/networkDefinition.json'

wisaaco commented 4 years ago

Thanks! Along the next days, I will try to dedicate some time to check your observations.

But be careful defining the paths of the projects and executions, many JSON files exist (and some are compressed by their size). For example:

Please check your python path! (I recommend you some python editor such as PyCharm)

Best

maqsood-tahir commented 4 years ago

Hi, I am facing the same issue. Some of the examples run and some don't. For reference, one error message is appended below. Please have a look and give your valuable input.

(yafs) tahir@TM-ProBook-450-G2:~/yafs/YAFS/src$ ./run_tutorial1.sh Traceback (most recent call last): File "examples/DynamicAllocation/main.py", line 145, in main(simulated_time=12000) File "examples/DynamicAllocation/main.py", line 56, in main t.G = nx.read_graphml("Euclidean.graphml") File "</home/tahir/anaconda2/envs/yafs/lib/python2.7/site-packages/decorator.pyc:decorator-gen-622>", line 2, in read_graphml File "/home/tahir/.local/lib/python2.7/site-packages/networkx/utils/decorators.py", line 214, in _open_file fobj = _dispatch_dict[ext](path, mode=mode) IOError: [Errno 2] No such file or directory: 'Euclidean.graphml'

The content of run_tutorial.sh are:

export PYTHONPATH=$PYTHONPATH:/home/tahir/yafs/YAFS/src/:src/examples/DynamicAllocation/ python examples/DynamicAllocation/main.py

maqsood-tahir commented 4 years ago

Managed to run the examples that were not executing before. The problem was with path of 'Euclidean.graphml'. If we place the ./run_tutorial1.sh in the directory where the example code is then it runs perfectly :)

Cheers