Agent does not change cell even when the cell is available
In order to reproduce this, please use the following:
width = 60 # With of map
height = 60 # Height of map
nr_trains = 15 # Number of trains that have an assigned task in the env
cities_in_map = 8 # Number of cities where agents can start or end
seed = 22 # Random seed
grid_distribution_of_cities = False # Type of city distribution, if False cities are randomly placed
max_rails_between_cities = 2 # Max number of tracks allowed between cities. This is number of entry point to a city
max_rail_in_cities = 6 # Max number of parallel tracks within a city, representing a realistic trainstation
rail_generator = sparse_rail_generator(max_num_cities=cities_in_map,
seed=seed,
grid_mode=grid_distribution_of_cities,
max_rails_between_cities=max_rails_between_cities,
max_rails_in_city=max_rail_in_cities,
)
# The schedule generator can make very basic schedules with a start point, end point and a speed profile for each agent.
# The speed profiles can be adjusted directly as well as shown later on. We start by introducing a statistical
# distribution of speed profiles
# Different agent types (trains) with different speeds.
speed_ration_map = {1. : 0.25, # Fast passenger train
1. / 2.: 0.25, # Fast freight train
1. / 3.: 0.25, # Slow commuter train
1. / 4.: 0.25} # Slow freight train
# We can now initiate the schedule generator with the given speed profiles
schedule_generator = sparse_schedule_generator(speed_ration_map)
# We can furthermore pass stochastic data to the RailEnv constructor which will allow for stochastic malfunctions
# during an episode.
stochastic_data = {'prop_malfunction': 0.3, # Percentage of defective agents
'malfunction_rate': 30, # Rate of malfunction occurence
'min_duration' : 3, # Minimal duration of malfunction
'max_duration' : 20 # Max duration of malfunction
}
And then the following sequence of action described in the text file.moves.txt At step 17 (or 16, depends on your notation), agent 11 transition from (7,34) to (7,35), but agent 1, which has a fractional position value of 4.0, does not move from (7,33) to (7,34) even though it is available.