Flatland issueshttps://gitlab.aicrowd.com/flatland/flatland/-/issues2024-02-03T12:14:44Zhttps://gitlab.aicrowd.com/flatland/flatland/-/issues/351How To Choose The Right Air Compressor For Your Facility2024-02-03T12:14:44Zhow-generators-can-save-business-during-outageHow To Choose The Right Air Compressor For Your FacilitySelecting the right air compressor for your facility is a critical decision that can significantly impact your operations' efficiency, productivity, and overall cost-effectiveness. With various types, sizes, and features available, under...Selecting the right air compressor for your facility is a critical decision that can significantly impact your operations' efficiency, productivity, and overall cost-effectiveness. With various types, sizes, and features available, understanding your specific requirements and evaluating key factors will help you make an informed choice. If you need more information, then click [https://www.ablesales.com.au/air-compressors-factory-direct/](https://www.ablesales.com.au/air-compressors-factory-direct/)
**How do I maintain and service my air compressor?**
Ensuring the longevity, reliability, and optimal performance of your air compressor relies heavily on meticulous maintenance and consistent servicing. This article aims to offer you comprehensive guidelines, encompassing a diverse range of practices to maintain and service your air compressor effectively. By following these guidelines, you can mitigate the risk of breakdowns, reduce downtime, and enhance the overall efficiency of your compressed air system.
**I. Routine Inspection and Maintenance**
Regular Visual Inspections: Perform visual inspections of your compressor to identify any signs of leaks, damage, or abnormal wear. Check for loose connections, worn belts, and proper oil levels.
Lubrication: Follow the manufacturer's guidelines for lubricating your compressor's moving parts. Monitor oil levels regularly and change the oil as recommended.
Air Filters: Clean or replace air filters at regular intervals to maintain proper airflow and prevent dust and debris from entering the compressor.
Cooling System: Ensure the cooling system is clean and free of debris. Check cooling fins, radiators, and fans regularly and clean or repair them as necessary.
**II. Scheduled Servicing and Maintenance**
Maintenance Schedule: [Crafting a maintenance schedule](https://www.dynaway.com/blog/creating-an-effective-maintenance-plan-what-should-you-include) that aligns with the manufacturer's recommendations is crucial for the optimal performance of your air compressor. This schedule should take into account various factors, including operating hours, duty cycle, and environmental conditions. By adhering to this schedule, you can ensure timely inspections, servicing, and component replacements, safeguarding the longevity and efficiency of your compressor.
Another critical aspect of maintenance is regularly assessing the belt tension and alignment. This step is essential to guarantee proper power transmission within the compressor system and prevent excessive wear. By checking the belt tension and alignment at regular intervals, you can identify any deviations and make necessary adjustments or replacements to maintain optimal performance and prevent potential issues.
Drainage of Condensate: Regularly drain condensate from the compressor's receiver tank and air filters to prevent moisture build-up, which can lead to corrosion and reduced efficiency.
Valve and Fitting Inspection: Inspect and clean valves and fittings to ensure proper operation and prevent air leaks. Replace worn-out or damaged components.
Electrical System: Check electrical connections, wiring, and controls for any signs of wear, damage, or loose connections. Follow safety protocols when working with electrical components.
Safety Systems: Test and verify the operation of safety systems, including pressure relief valves and pressure switches, to ensure their effectiveness in protecting the compressor and personnel.
**III. Professional Maintenance and Servicing**
Manufacturer's Recommendations: Follow the manufacturer's guidelines regarding professional maintenance and servicing intervals. This may involve tasks such as complete system inspections, component replacements, and performance testing.
Qualified Service Technicians: Engage qualified and experienced service technicians who are trained in air compressor maintenance and have knowledge of your specific compressor model.
Documentation and Record Keeping: Maintain accurate records of maintenance activities, including dates, tasks performed, and any observations or issues. This documentation will help track service history and aid future troubleshooting.
Regular maintenance and servicing are essential for keeping your air compressor in optimal condition and ensuring its longevity. By following these guidelines, performing routine inspections, adhering to maintenance schedules, and engaging professional technicians when needed, you can minimize downtime, maximize performance, and extend the lifespan of your air compressor.
**How to [choose a perfect air compressor](https://www.wikihow.com/Choose-an-Air-Compressor)?**
This comprehensive guide aims to provide valuable insights and step-by-step instructions to assist you in choosing the perfect air compressor for your facility.
**I. Assessing Your Needs**
Understanding Application Requirements: Identify the specific tasks, tools, and equipment that require compressed air in your facility. Determine the required air pressure, airflow, and duty cycle for each application.
Air Quality Considerations: Evaluate if your applications demand oil-free air or if you can tolerate some level of air contamination. Certain industries, such as food processing or pharmaceuticals, may require strict air quality standards.
Available Power Sources: Assess the power options in your facility, including electrical, gasoline, diesel, or pneumatic. Consider factors such as energy efficiency, availability, cost, and environmental considerations.
**II. Types of Air Compressors**
Reciprocating Air Compressors: Explore the features, advantages, and limitations of reciprocating compressors, which use piston-cylinder arrangements to compress air.
Rotary Screw Air Compressors: Understand the working principle, benefits, and considerations associated with rotary screw compressors, known for their continuous and high-volume airflow.
Centrifugal Air Compressors: Learn about the characteristics, applications, and limitations of centrifugal compressors, which utilize rotating impellers to generate compressed air.
Scroll Air Compressors: Consider the compact design, quiet operation, and suitability for lighter-duty applications provided by scroll compressors.
**III. Sizing and Capacity**
Determining Airflow Requirements: Calculate the total airflow demand based on the cumulative requirements of all your applications, factoring in any future expansions.
Selecting the Right Tank Size: Evaluate the necessary air storage capacity to meet peak demands, balance system stability, and consider space constraints.
Assessing Duty Cycle: Determine if your operations require continuous or intermittent compressed air supply to select the appropriate compressor that matches the duty cycle.
**IV. Evaluating Performance Factors**
Horsepower and Pressure: Understand the relationship between horsepower and pressure requirements to ensure the compressor's capabilities align with your applications' demands.
Energy Efficiency: Consider energy-efficient features like variable speed drives, energy recovery systems, and smart control options to reduce operating costs and environmental impact.
Noise Levels: Evaluate the noise emissions of different compressor models and select one that complies with noise regulations and ensures a comfortable working environment.
Maintenance Requirements: Assess the maintenance needs of each compressor type, including routine servicing, oil changes, filter replacements, and overall reliability.
**V. Additional Considerations**
Budget and Total Cost of Ownership: Compare the initial purchase cost, installation expenses, and long-term operational costs to determine the overall cost-effectiveness of the compressor.
Manufacturer and Support: Research reputable manufacturers known for quality products and reliable customer support to ensure long-term satisfaction and availability of spare parts.
Environmental Impact: Consider the environmental implications of your choice, such as energy consumption, emissions, and compliance with environmental regulations.
**Conclusion**
Selecting the right air compressor for your facility requires careful consideration of your specific needs, including application requirements, available power sources, and desired performance factors.https://gitlab.aicrowd.com/flatland/flatland/-/issues/350Add mathematical formulation of the flatland problem to flatland book2024-02-03T12:15:42ZmmartiAdd mathematical formulation of the flatland problem to flatland bookWe should consider adding a mathematical formulation of the flatland problem to the flatland book, maybe like in the thesis of Ryzner (see https://dspace.cvut.cz/bitstream/handle/10467/87776/F3-BP-2020-Ryzner-Filip-BP_FILIP_RYZNER_2020.p...We should consider adding a mathematical formulation of the flatland problem to the flatland book, maybe like in the thesis of Ryzner (see https://dspace.cvut.cz/bitstream/handle/10467/87776/F3-BP-2020-Ryzner-Filip-BP_FILIP_RYZNER_2020.pdf on page 8).
I am not sure that all the details there are correct though.https://gitlab.aicrowd.com/flatland/flatland/-/issues/349Add more material on OR / planning approaches to flatland book2023-04-14T13:29:16ZmmartiAdd more material on OR / planning approaches to flatland bookIn the flatland book (see https://flatland.aicrowd.com/intro.html), section "Tutorials", we should add more material on OR / planning approaches (e.g. complete path reservation, prioritized planning, conflict-based methods, ...).
We shou...In the flatland book (see https://flatland.aicrowd.com/intro.html), section "Tutorials", we should add more material on OR / planning approaches (e.g. complete path reservation, prioritized planning, conflict-based methods, ...).
We should have links to the relevant papers, and ideally some baseline code ready to run in a notebook.https://gitlab.aicrowd.com/flatland/flatland/-/issues/347performance of agent_chains.find_swaps2022-11-23T23:19:36Zhagrid67performance of agent_chains.find_swaps@adrian_egli has identified performance issues with `find_swaps()` which finds adjacent deadlocked agents.@adrian_egli has identified performance issues with `find_swaps()` which finds adjacent deadlocked agents.hagrid67hagrid67https://gitlab.aicrowd.com/flatland/flatland/-/issues/346[Bug] Initial direction of agents may not be valid.2022-05-06T09:16:14Zqimaili[Bug] Initial direction of agents may not be valid.There is chance that the initial direction of agents is not valid! For example, when `agent.initial_position` is a east-west rail, the `agent.initial_direction` may be NORTH sometimes, although the chance is very small.
Following scrip...There is chance that the initial direction of agents is not valid! For example, when `agent.initial_position` is a east-west rail, the `agent.initial_direction` may be NORTH sometimes, although the chance is very small.
Following script can reproduce the bug within several hundred of loops.
```python
from flatland.envs.rail_env import RailEnv
from flatland.envs.rail_generators import SparseRailGen
import numpy as np
env = RailEnv(
width=60,
height=60,
number_of_agents=4,
rail_generator=SparseRailGen(max_num_cities=6, max_rails_between_cities=3),
)
cnt = 0
while True:
env.reset()
for agent in env.agents:
possible_transitions = env.rail.get_transitions(
*agent.initial_position, agent.initial_direction
)
if all(np.array(possible_transitions) == 0):
print("Wrong initial direction!!!!! No possible transition from it!!!")
cnt += 1
print(f"\r{cnt}", end="")
```
My test environment:
- OS: Ubuntu 20.04 LTS (GNU/Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)
- python==3.6.13
- flatland==3.0.15https://gitlab.aicrowd.com/flatland/flatland/-/issues/344Flatland for Train Platforming Problem with modified objectives for agents2021-12-15T03:33:22Zsudhanshu_mishraFlatland for Train Platforming Problem with modified objectives for agents### Flatland for TPP (Train Platforming Problem)
I was wondering whether it is possible to generate specific environments in flatland for the train platforming problem and modify the objective of each agent to reach one of the many possi...### Flatland for TPP (Train Platforming Problem)
I was wondering whether it is possible to generate specific environments in flatland for the train platforming problem and modify the objective of each agent to reach one of the many possible stops (platforms) in a given interval of time.
If there has been some work done in this area can anyone point me in that direction?https://gitlab.aicrowd.com/flatland/flatland/-/issues/340Trouble installing flatland2023-06-06T13:37:46ZnkouamelaTrouble installing flatlandI followed the instruction for setup (prerequisite and stable realease), but this is what i get when i try running flatland-demo
`(flatland-rl) root@LAPTOP-AOPAAUOQ:~# flatland-demo ...I followed the instruction for setup (prerequisite and stable realease), but this is what i get when i try running flatland-demo
`(flatland-rl) root@LAPTOP-AOPAAUOQ:~# flatland-demo open_window - pyglet Traceback (most recent call last): File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/__init__.py", line 378, in __getattr__ return getattr(self._module, name) AttributeError: 'NoneType' object has no attribute 'Window' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/root/anaconda3/envs/flatland-rl/bin/flatland-demo", line 8, in <module> sys.exit(demo()) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/click/core.py", line 1128, in __call__ return self.main(*args, **kwargs) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/flatland/cli.py", line 53, in demo show_predictions=False File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/flatland/utils/rendertools.py", line 63, in render_env show_predictions, show_rowcols, frames, episode, step, selected_agent, return_image) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/flatland/utils/rendertools.py", line 533, in render_env return_image=return_image File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/flatland/utils/rendertools.py", line 761, in render_env_svg self.gl.show() File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/flatland/utils/graphics_pgl.py", line 56, in show self.open_window() File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/flatland/utils/graphics_pgl.py", line 24, in open_window self.window = pgl.window.Window(resizable=True, vsync=False, width=1200, height=800) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/__init__.py", line 384, in __getattr__ __import__(import_name) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/window/__init__.py", line 1896, in <module> gl._create_shadow_window() File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/gl/__init__.py", line 208, in _create_shadow_window _shadow_window = Window(width=1, height=1, visible=False) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py", line 166, in __init__ super(XlibWindow, self).__init__(*args, **kwargs) File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/window/__init__.py", line 501, in __init__ display = get_platform().get_default_display() File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/window/__init__.py", line 1845, in get_default_display return pyglet.canvas.get_display() File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/canvas/__init__.py", line 82, in get_display return Display() File "/root/anaconda3/envs/flatland-rl/lib/python3.7/site-packages/pyglet/canvas/xlib.py", line 86, in __init__ raise NoSuchDisplayException('Cannot connect to "%s"' % name) pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"`https://gitlab.aicrowd.com/flatland/flatland/-/issues/338macOS "Can't find OpenGL" error - newer version of pyglet needed2021-09-30T19:49:30Zmiroslav_matochamacOS "Can't find OpenGL" error - newer version of pyglet neededHello,
I am getting following error when trying to run flatland builded from the source on macOs Big Sur Version 11.1. I am pretty sure OpenGL is installed. I found that this was a common problem when using older versions of pyglet, but ...Hello,
I am getting following error when trying to run flatland builded from the source on macOs Big Sur Version 11.1. I am pretty sure OpenGL is installed. I found that this was a common problem when using older versions of pyglet, but it was repaired in version 1.5.11. However, I cannot use this version, as gym 0.14.0 has requirement for lower versions of this library. Is there any easy fix available for this trouble?
```
(flatland) Miroslavs-MacBook-Pro:project miroslavmatocha$ flatland-demo
open_window - pyglet
Traceback (most recent call last):
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 378, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'Window'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 378, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute '_create_shadow_window'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/miroslavmatocha/miniconda3/envs/flatland/bin/flatland-demo", line 33, in <module>
sys.exit(load_entry_point('flatland-rl', 'console_scripts', 'flatland-demo')())
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/cli.py", line 49, in demo
env_renderer.render_env(
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/rendertools.py", line 62, in render_env
return self.renderer.render_env(show, show_agents, show_inactive_agents, show_observations,
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/rendertools.py", line 526, in render_env
return self.render_env_svg(show=show,
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/rendertools.py", line 761, in render_env_svg
self.gl.show()
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/graphics_pgl.py", line 56, in show
self.open_window()
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/graphics_pgl.py", line 24, in open_window
self.window = pgl.window.Window(resizable=True, vsync=False, width=1200, height=800)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 384, in __getattr__
__import__(import_name)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/window/__init__.py", line 1896, in <module>
gl._create_shadow_window()
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 384, in __getattr__
__import__(import_name)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/gl/__init__.py", line 100, in <module>
from pyglet.gl.lib import GLException
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/gl/lib.py", line 141, in <module>
from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/gl/lib_agl.py", line 48, in <module>
gl_lib = pyglet.lib.load_library(
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/lib.py", line 118, in load_library
return self.load_framework(kwargs['framework'])
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/lib.py", line 286, in load_framework
raise ImportError("Can't find framework %s." % path)
ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework.
```https://gitlab.aicrowd.com/flatland/flatland/-/issues/337Agent counts itself as ``other_agent_encountered`` in dead end2021-08-26T08:48:21Zoussama_aAgent counts itself as ``other_agent_encountered`` in dead endHello,
In the following example:
[frame_2](/uploads/5ffcdd715d3aeeb906d2ca4c1a9faa77/frame_2.bmp)
the train has the following observation:
```
Node(dist_own_target_encountered=0, dist_other_target_encountered=0, dist_other_agent_enco...Hello,
In the following example:
[frame_2](/uploads/5ffcdd715d3aeeb906d2ca4c1a9faa77/frame_2.bmp)
the train has the following observation:
```
Node(dist_own_target_encountered=0, dist_other_target_encountered=0, dist_other_agent_encountered=0,
dist_potential_conflict=0, dist_unusable_switch=0, dist_to_next_branch=0, dist_min_to_target=5.0,
num_agents_same_direction=0, num_agents_opposite_direction=0, num_agents_malfunctioning=0, speed_min_fractional=1.0,
num_agents_ready_to_depart=0, position=(1, 1), childs={'L': -inf, 'F': Node(dist_own_target_encountered=inf,
dist_other_target_encountered=inf, dist_other_agent_encountered=inf, dist_potential_conflict=inf, dist_unusable_switch=inf, dist_to_next_branch=1, dist_min_to_target=4.0, num_agents_same_direction=0,
num_agents_opposite_direction=0, num_agents_malfunctioning=0, speed_min_fractional=1.0,
num_agents_ready_to_depart=0, position=(1, 0), childs={'L': -inf, 'F': Node(dist_own_target_encountered=5,
dist_other_target_encountered=inf, **dist_other_agent_encountered=2**, dist_potential_conflict=inf,
dist_unusable_switch=inf, dist_to_next_branch=5, dist_min_to_target=0, num_agents_same_direction=0,
num_agents_opposite_direction=1, num_agents_malfunctioning=0, speed_min_fractional=1.0,
num_agents_ready_to_depart=0, position=(1, 4), childs={'L': -inf, 'F': -inf, 'R': -inf, 'B': -inf}), 'R': -inf, 'B': -inf}), 'R': -inf, 'B': -inf})
```
As you can see, the agent does not distinguish itself from other agents that is why we have `dist_other_agent_encountered=2`.
In the `TreeObsForRailEnv._explore_branch` method the following code is responsible for saving the distance to other encountered agents:
```
if position in self.location_has_agent:
if tot_dist < other_agent_encountered:
other_agent_encountered = tot_dist
```
So I think it would be better if `self.location_has_agent` stores the `id` of the agent if it is occupied and check if it is the same as the `handle` passed to the `TreeObsForRailEnv.get` method.
Thank you in advance,https://gitlab.aicrowd.com/flatland/flatland/-/issues/332Editor - migrate from unsupported jupyter_canvas_widget to ipycanvas2021-07-03T23:10:26Zhagrid67Editor - migrate from unsupported jupyter_canvas_widget to ipycanvashagrid67hagrid67https://gitlab.aicrowd.com/flatland/flatland/-/issues/331Separate utilities in wrappers from Rllib2021-07-02T14:28:28ZmmartiSeparate utilities in wrappers from Rllibhttps://gitlab.aicrowd.com/flatland/flatland/-/issues/329actions prior to malfunction cannot be cancelled2020-12-15T16:26:45Zhagrid67actions prior to malfunction cannot be cancelledA competitor grumbled that an action sent to an agent before it malfunctioned, would always be performed after the malfunction completed.
Erik has commented that some actions do have this semantic, eg turning, because the "points" at a j...A competitor grumbled that an action sent to an agent before it malfunctioned, would always be performed after the malfunction completed.
Erik has commented that some actions do have this semantic, eg turning, because the "points" at a junction may already be set. However there is a case for allowing an agent to issue a "stop", prior to resumption of power. We would then need to implement something to remember that the agent is committed to turning left, travelling forward, etc.https://gitlab.aicrowd.com/flatland/flatland/-/issues/327Invalid agent directions while visiting cells with ShortestPathPredictorForRa...2020-09-16T13:19:03ZakopaczInvalid agent directions while visiting cells with ShortestPathPredictorForRailEnvSometimes, the agent's direction of the last visited cell generated by the `ShortestPathPredictorForRailEnv` marks an invalid direction - the cell does not permit that transition.
Possible source of the problem that the initial agent di...Sometimes, the agent's direction of the last visited cell generated by the `ShortestPathPredictorForRailEnv` marks an invalid direction - the cell does not permit that transition.
Possible source of the problem that the initial agent direction is appended to the list of visited cells when reaching the `agent.target` position (link: https://gitlab.aicrowd.com/flatland/flatland/blob/master/flatland/envs/predictions.py#L163).
```pyhton
for index in range(1, self.max_depth + 1):
# if we're at the target, stop moving until max_depth is reached
if new_position == agent.target or not shortest_path:
prediction[index] = [index, *new_position, new_direction, RailEnvActions.STOP_MOVING]
visited.add((*new_position, agent.direction))
continue
```
Suggestion: Change `agent.direction` to the `new_direction` variable, so the list of the visited cells would contain the directions of the agent's path.
Version: flatland-rl==2.2.1https://gitlab.aicrowd.com/flatland/flatland/-/issues/326where is the `observation_utils`?2023-09-21T10:48:24Zxzhaomawhere is the `observation_utils`?following the tutorial here:
https://flatland.aicrowd.com/getting-started/rl/single-agent.html
The fourth line of :
```
from flatland.envs.rail_env import RailEnv
from flatland.envs.rail_generators import sparse_rail_generator
from fla...following the tutorial here:
https://flatland.aicrowd.com/getting-started/rl/single-agent.html
The fourth line of :
```
from flatland.envs.rail_env import RailEnv
from flatland.envs.rail_generators import sparse_rail_generator
from flatland.envs.schedule_generators import sparse_schedule_generator
from utils.observation_utils import normalize_observation
from flatland.envs.observations import TreeObsForRailEnv
```
there is actually no `utils`.
And under `flatland.utils`, there's no `observation_utils`...
Is the project updated? Where should I find that function?https://gitlab.aicrowd.com/flatland/flatland/-/issues/325evaluator service timeout - return done all and -1 reward2020-07-08T21:32:40Zhagrid67evaluator service timeout - return done all and -1 rewardinstead of terminating the session, the episode should be terminated by setting done[`__all__`] and reward should be minus 1.
If possible also merge the episode action saving code from evaluator2 in neurips2020_flatland_baselines.
Que...instead of terminating the session, the episode should be terminated by setting done[`__all__`] and reward should be minus 1.
If possible also merge the episode action saving code from evaluator2 in neurips2020_flatland_baselines.
Questions:
- can the done all response to step be generated outside of the env?
- or do we need genuine observations?
- should clients be able to handle empty observations for done agents?
hagrid67hagrid67https://gitlab.aicrowd.com/flatland/flatland/-/issues/324RailEnv Persistence - store SparseRailGenerator agents_hints like num_cities2020-07-03T17:03:40Zhagrid67RailEnv Persistence - store SparseRailGenerator agents_hints like num_citiesSparse_rail_generator returns a key `agents_hints` in its second return value, a dict known as "optionals" in RailEnv.
env.reset() passes the optionals["agents_hints"] to the schedule_generator. optionals["agent_hints"]["num_cities"] is...Sparse_rail_generator returns a key `agents_hints` in its second return value, a dict known as "optionals" in RailEnv.
env.reset() passes the optionals["agents_hints"] to the schedule_generator. optionals["agent_hints"]["num_cities"] is used in the formula for the max_episode_steps calculated by sparse_schedule_generator.
However when the env is persisted this information is currently lost.
The latter versions of `persistence.py` do save the max_step_size in its own key in the pickled env_dict.
This is enough for the schedule_from_file schedule generator.
(Earlier versions left this out and result in a max_steps of zero; this is affecting the 97 IL envs)
The sparse rail info may be useful for explaining env difficulty.
How to get hold of the hints and save them is not immediately obvious. It could form part of a re-factoring of the generators.https://gitlab.aicrowd.com/flatland/flatland/-/issues/323Unordered close-following agents2020-07-29T11:45:12Zhagrid67Unordered close-following agentsAs requested by Guillaume Sartoretti - the agents should be able to directly follow each other in any order.
Currently they can only follow in agent_id / handle order, because each agent is moved atomically in that order.
- Positions / ...As requested by Guillaume Sartoretti - the agents should be able to directly follow each other in any order.
Currently they can only follow in agent_id / handle order, because each agent is moved atomically in that order.
- Positions / cell locks are recorded in `rail_env.agent_positions`
- when an agent moves, its current cell is unlocked, and the new one locked.
- when the next agent moves, it checks the partially updated table before moving (thus "cross-over" conflicts are avoided)
- it means a higher-id agent can step into the cell vacated by a lower-id one, but not vice-versa.
**Implementation**
- use / copy existing loop over agents to check speed, valid actions, malfunction, etc
- for each agent ready to move cell (ie whose agent.speed_data position_fraction = 1) create an edge in a DiGraph from the existing cell (row,col) to the new one.
- Check the graph for agent conflicts:
- self loops mean the agent is stationary and this takes priority.
- cell swaps appear as loops of size 2. Mark both agents as cannot move.
- agents trying to move into a cell occupied by a stationary agent are blocked.
- agents *close_following* another agent are allowed to move, however this means we need to:
- check that chains of agents which are *close_following* are not blocked.
- A chain of *close_following* agents can be blocked by a stationary agent, or a cell-swap.
- a chain of *close_following* agents can be branching so the whole tree is affected by a block at the head.
- Special rule for two agents both trying to move into the same cell:
- The agent with the lower index wins
- Implication: an agent can "butt into" a close-following chain if it has a lower index than the one it will block.
- Implication: at a branch-point in a merging tree of agents, the agent with the lower index goes first.
In the diagram below,
- a black node indicates a moving agent (really the agent is the edge, and the two nodes are its current and next positions)
- a self-loop edge indicates a stationary agent.
- a red node indicates a cell containing a stopped / blocked agent.
- a purple node indicates a cell containing a stopped agent in an attempted swap-over pair.
- a blue node indicates an empty contended cell (two or more agents trying to move into it)
- a magenta node (slightly brighter purple) indicates an occupied contended cell, where the occupying agent is moving out, but two or more agents are trying to move in.
![image](/uploads/a8eed7d6dba3d0956241c5eab85ed8d0/image.png)hagrid67hagrid67https://gitlab.aicrowd.com/flatland/flatland/-/issues/322Exception error while running flatland-evaluator2020-09-20T05:08:45ZatutejException error while running flatland-evaluatorError : env_client.step called before env_client.env_create() call
Traceback (most recent call last):
File "/home/[user]/anaconda3/lib/python3.7/site-packages/flatland/evaluators/service.py", line 873, in run
self.handle_env_step(...Error : env_client.step called before env_client.env_create() call
Traceback (most recent call last):
File "/home/[user]/anaconda3/lib/python3.7/site-packages/flatland/evaluators/service.py", line 873, in run
self.handle_env_step(command)
File "/home/[user]/anaconda3/lib/python3.7/site-packages/flatland/evaluators/service.py", line 588, in handle_env_step
"env_client.step called before env_client.env_create() call")
Exception: env_client.step called before env_client.env_create() call
What's interesting is I haven't modified service.py in any manner.https://gitlab.aicrowd.com/flatland/flatland/-/issues/321Group by scores in the evaluation service by the test groups2020-06-05T13:53:41ZmohantyGroup by scores in the evaluation service by the test groupsAt the moment, the evaluation service simply takes a mean of rewards across all the episodes.
We want to compute the final scores by grouping all the envs by the test groups. So the final scores will be mean of mean of the said score in ...At the moment, the evaluation service simply takes a mean of rewards across all the episodes.
We want to compute the final scores by grouping all the envs by the test groups. So the final scores will be mean of mean of the said score in a single test group.https://gitlab.aicrowd.com/flatland/flatland/-/issues/320msgpack loads agent data as garbage bytes2020-06-03T09:44:18Zhagrid67msgpack loads agent data as garbage bytesWhen loading an env with msgpack we seem to get binary garbage in the agent data.
We know that msgpack doesn't handle typing.NamedTuple - it recreates a (unnamed) tuple. See #282. There is a workaround in agent_utils for this. But the...When loading an env with msgpack we seem to get binary garbage in the agent data.
We know that msgpack doesn't handle typing.NamedTuple - it recreates a (unnamed) tuple. See #282. There is a workaround in agent_utils for this. But the data loaded still appears as garbage.
I haven't been able to reproduce this in a standalone test case (saving a named tuple etc) but can reproduce in flatland.
I believe this this did work at some point (no thanks to me).
More details to follow.