Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformating of Strategix and Cetautomatix nodes #39

Merged
merged 21 commits into from
Jul 3, 2021
Merged

Conversation

mAxYoLo01
Copy link
Collaborator

Purpose

The goal of this PR is to reformat most of Cetautomatix and Strategix nodes, as they were poorly written in the previous year

Details of what has changed

  • Created an Action class as well as all its children to represent all possible types of Actions. This allows for better customization and much better comprehension of the entire codebase
  • Temporarily removed most actions, to put them back one by one once they are done. Currently present: Phare & Pavillon
  • Merged Score class with the Strategix node (useless class on its own)
  • BIG change: New Robot class with much more readable functions (seeing the difference between base and custom functions), trying to separate some actions in their own class. Old Robot class still present in the old_robot.py for the moment.

Start of reformating of cetautomatix and strategix
Available actions: both Phares & Pavillon
@mAxYoLo01 mAxYoLo01 changed the title Strategix Reformating of Strategix and Cetautomatix nodes Mar 19, 2021
Copy link
Member

@PhileasL PhileasL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve for the moment, I'll review it properly later. @mAxYoLo01 can continue his work this afternoon.

Copy link
Member

@3wnbr1 3wnbr1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice effort 👍

# "GOB38": {"COLOR": "GREEN", "IN_ECUEIL": True},
# "GOB40": {"COLOR": "GREEN", "IN_ECUEIL": True},
# "GOB43": {"COLOR": "GREEN", "IN_ECUEIL": True},
# }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ?! 😂🆘

@@ -0,0 +1,14 @@
class Action:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a docstring to document that this is an abstract base class

super().__init__(position, **kwargs)
self.step = 0

def get_initial_position(self, robot):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add docstring

position = (self.position[0] + offset, robot.width_param / 2 + 0.05)
return position

def start_actuator(self, robot):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

# elif self.bonPortGros.pos == 'Out' and self.bonPortPetit.pos == 'Good':
# self.score += 5
# else:
# self.score += 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again ?

# else:
# offset = (0, 0.1)
# elements[self._current_action]["Rot"] = 90
# self.drop = NC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

@@ -0,0 +1,505 @@
#!/usr/bin/env python3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the file if you don't use it anymore. Git is there for you

@3wnbr1 3wnbr1 force-pushed the master branch 2 times, most recently from 2b9eadd to 4b68ac1 Compare March 24, 2021 14:15
Copy link
Member

@3wnbr1 3wnbr1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratz

@mAxYoLo01 mAxYoLo01 merged commit ccb6a3c into master Jul 3, 2021
@mAxYoLo01 mAxYoLo01 deleted the strategix branch July 3, 2021 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants