Goolo2 / SOScheduler

0 stars 0 forks source link

Issue with installation & running the code #1

Open BrandonGel opened 2 hours ago

BrandonGel commented 2 hours ago

Incomplete Requirement.txt

In this code command below, there is no requirements.txt but just requirements in the repo. pip install -r requirements.txt

There are some packages missing in the requirement:

Overflow Error

Traceback (most recent call last):
  File "/home/bho36/SOScheduler/main.py", line 153, in <module>
    main()  
    ^^^^^^
  File "/home/bho36/SOScheduler/main.py", line 132, in main
    env, fire_centers = experiments.environments.get_environment(args)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bho36/SOScheduler/experiments/environments.py", line 10, in get_environment
    initial_fire, fire_centers = set_initial_fire(args.dimension, args.fire_size, args.fire_num)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bho36/SOScheduler/experiments/environments.py", line 82, in set_initial_fire
    r, c = r_center + dr, c_center + dc
           ~~~~~~~~~^~~~
OverflowError: Python integer -1 out of bounds for uint8

I have seen this setup in other implementations for wildfire, but I keep getting this error for overflow. I am not sure why Python is complaining on my installation. I modify the code in experiments/environment.py to this on line 82.

        for (dr, dc) in deltas:
            if dr < 0:
                r = r_center - np.abs(dr)
            else:
                r = r_center + dr

            if dc < 0:
                c = c_center - np.abs(dc)
            else:
                c = c_center + dc
            fires.append((r, c))
Goolo2 commented 2 hours ago

您好,您的来信已收到!将尽快回复,谢谢!