Ecosim

freelancer
This text outlines a programming assignment that involves developing a program called Ecosim, which requires implementing various object-oriented concepts such as inheritance, aggregation/composition, polymorphism, and encapsulation. The instructions emphasize the importance of clear documentation, utilizing git for progress tracking, and writing tests specifically for the Vector2D class.
Published

January 12, 2022


• You must demonstrate multiple examples of inheritance.

You may need to include classes that were not mentioned to demonstrate appropriate inheritance relationships.

• You must demonstrate multiple examples of aggregation/composition/association. You may need to create lists of animals or tiles in the EcoSim class.

• You must create methods not mentioned in the text above.

• You must include one more type of animal, and one more plant in your program.

• You must demonstrate polymorphism by calling overridden methods, or by checking the types of objects.

• You must demonstrate good encapsulation by making dangerous variables private or protected and providing getter or setter methods to them.

• You must include str and repr methods for each class. You may print(self) or print(animals) to help you with debugging.

• You must update your UML diagram written in part 1 and submit it with your code.

• Your code must be documented appropriately using docstrings.

• You must make at least 10 commits using git with appropriate comments.

You must use git version control to keep track of your progress during implementation. Only a local git repository is required in this assignment. You are not required to use an online repository, but if you choose to, please make sure your online repository is private. You should perform regular commits as you implement features and fix errors. Your commit comments should be short and reflect the changes that were made.

• You must write a unit test for the game.Vector2D class.

You will find Vector2D in the game.py file. You must create a new file called test_vector2d.py and write a test method for each of the following methods in Vector2D: add, subtract, scale, length, distance, normalize. You may either use the unittest or the pytest modules. Each test method should call those methods two times using different arguments: one safe set of arguments, and one dangerous set of arguments.