acsicuib / YAFS

Yet Another Fog Simulator (YAFS)
MIT License
101 stars 73 forks source link

Cannot run any sample program #30

Closed MarkoRimac closed 4 years ago

MarkoRimac commented 4 years ago

Hello, I've seen issue #14 being fixed and closed, but I'm getting the exact same error with the latest clone.

wisaaco commented 4 years ago

Hello Marko, Can you provide more detailed information about the error? Thanks

MarkoRimac commented 4 years ago

Ok, here it is:

Traceback (most recent call last): File "C:\Python27\lib\site-packages\yafs\core.py", line 383, in add_source_population self.send_message(name_app, msg, idDES, self.SOURCE_METRIC) File "C:\Python27\lib\site-packages\yafs\core.py", line 183, in __send_message paths,DES_dst = self.selector_path[app_name].get_path(self,app_name, message, self.alloc_DES[idDES], self.alloc_DES, self.alloc_module, self.last_busy_time) TypeError: get_path() takes exactly 9 arguments (8 given)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:/Users/Marko/Desktop/YAFS/src/examples/Tutorial/main1.py", line 155, in main(simulated_time=1000) File "C:/Users/Marko/Desktop/YAFS/src/examples/Tutorial/main1.py", line 144, in main s.run(stop_time,show_progress_monitor=False) File "C:\Python27\lib\site-packages\yafs\core.py", line 1057, in run self.env.run(until=until) #This does not stop the simpy.simulation at time. We have to force the stop File "C:\Python27\lib\site-packages\simpy\core.py", line 138, in run self.step() File "C:\Python27\lib\site-packages\simpy\core.py", line 230, in step raise exc TypeError: get_path() takes exactly 9 arguments (8 given)

Process finished with exit code 1

Same error occurs in every YAFS/src/examples program I try to run.

wisaaco commented 4 years ago

I have been reviewing the repository code but I have not found anything abnormal.

The main1.py needs the selectorPath defined in the file simpleSelection.py.

In that file, the function signature is:

def get_path(self, sim, app_name, message, topology_src,alloc_DES, alloc_module,traffic,from_des):

with 8 parameters.

This function is called by the core.py file in 204 line:

paths,DES_dst = self.selector_path[app_name].get_path(self,app_name, message, self.alloc_DES[idDES], self.alloc_DES, self.alloc_module, self.last_busy_time,from_des=idDES)

with 8 parameters: self 1, app_name 2, message 3, self.alloc_DES[idDES] 4, self.alloc_DES 5, self.alloc_module 6, self.last_busy_time 7 ,from_des=idDES 8.

The code in the git is right.

Maybe you are using another core.py file. Have you installed YAFS using pip? The pip version isn't longer maintained. Or maybe, you have an incorrect path... Could you check & compare the line 204 of your core.py file? In order to check if this file is used, try to modify the function signature, for example, adding two or more arguments inline 204.