Completed the factory #4

Merged
JMR-dev merged 14 commits from jr-membervariable_class_access into main 2022-08-09 15:34:20 +00:00
2 changed files with 172 additions and 57 deletions
+12
View File
@@ -0,0 +1,12 @@
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
<!DOCTYPE html>
<html>
<head>
<title>Fleet.drawio.html</title>
<meta charset="utf-8"/>
</head>
<body>
<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="{&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;resize&quot;:true,&quot;xml&quot;:&quot;&lt;mxfile host=\&quot;Electron\&quot; modified=\&quot;2022-07-19T18:53:35.103Z\&quot; agent=\&quot;5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/19.0.3 Chrome/102.0.5005.63 Electron/19.0.3 Safari/537.36\&quot; etag=\&quot;Aq1AchRokJDHtKoxO1RO\&quot; version=\&quot;19.0.3\&quot; type=\&quot;device\&quot;&gt;&lt;diagram id=\&quot;bYEdDUY9EFOD96TcEZc_\&quot; name=\&quot;Page-1\&quot;&gt;7V1tc5s6Fv41mbn3QzIg3j/aTtJ0p7npNtm291OHGNnmBiMWcGL316+EBTYSxMQWlj2rTqc1QgjQec55jo50xIUxmi8/pX4yu0cBjC6AFiwvjOsLAHTgufg/UrJal7iGsS6YpmFAK20KHsPfkBZqtHQRBjCrVcwRivIwqReOURzDcV4r89MUvdWrTVBUv2viTyFX8Dj2I770RxjkM/oWlrYpv4PhdFbeWdfomblfVqYF2cwP0NtWkXFzYYxShPL1r/lyBCPSeWW/rK+7bTlbPVgK47zLBc7DKkv/spJ5Au5+vt6iz/aDd0lbefWjBX3hx1mYJGE8xaW3EYQ5ffh8VfZI9hbOIz/GR8MJivNHekbHx34UTmP8e4wfCaa44BWmeYg7c0BP5CjBpeNZGAVf/BVakAfPcn/8Uh4NZygNf+Nm/Yi2iU+nOcUFsGs1HsmVuFjD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rwVpm+tr0Gw2Q2GCYbHG6Yfpmm888A/c7mxstsObW9bzefW3v/Jl7MO3c87fLbyn1t7PL2jg1SlDyVWidoXMCM/KrMve2edht6ms3oE9bTYLfTl838hPyco2BR2OF/YJ6vSu/PLQvu4BZF8131rpy7J4hw3QUaeguIGfBfAqcmLafeAJpMMnio8cn+FfwED+PFzfLmdfhTyzV9eXfZ4InvDX+R0Ofk1KAN7cuBGYPe9AHfvqDf2MtNHrEw6O/oqnax/59Dv2mB9hq7SU009n8XKK/CNxfGQEuW1eFlMZgYmEURGaZcUtdxUAWrNi3s5A9/nKN0NYr8rEWPqrKELZul5KHXTu/mjnr7zT/ykms3mL5lU5PMwvanYt3LKT/sr19hHOa/fhVD0dbn7OG2MXxrvytjE5oHrszYZGuIOimGOOvw6dZQiRzf+vMwIhp2B6NXSFqtj64EWF1g19dtAqtjIGIPs4sPU0T6d2MQUj+Z3aMAkhr/Aw==&lt;/diagram&gt;&lt;/mxfile&gt;&quot;,&quot;toolbar&quot;:&quot;pages zoom layers lightbox&quot;,&quot;page&quot;:0}"></div>
<script type="text/javascript" src="https://app.diagrams.net/js/viewer-static.min.js"></script>
</body>
</html>
+160 -57
View File
@@ -1,69 +1,87 @@
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
import random
import enum
# ABC is imported from the standard library since Python does not natively support abstract methods and classes. # ABC is imported from the standard library since Python does not natively support abstract methods and classes.
class Fleet(): class Fleet():
fleet_members = [] fleet_members = []
def __init__(self, vtype, movspeed, travelmed, vehicleid):
self.vehicletype = vtype
self.movementspeed = movspeed
self.travelmedium = travelmed
self.uuid = vehicleid
def displayAllFleetMembers(self): def displayAllFleetMembers(self):
for i in self.vehicles: for i in self.fleet_members:
print(i) print(str(i))
def displayVehicleType(self):
print(self.vehicletype)
def addVehicle(self, newVehicleId): def addVehicle(self, newVehicleId):
self.fleet_members.append(newVehicleId) self.fleet_members.append(newVehicleId)
class Vehicle(ABC): class Vehicle(ABC):
'''Defines the properties of vehicles''' '''Defines the properties of vehicles'''
# _fuelType = ("Diesel", "Gasoline", "Aviation Gas", "Electricity", "Nuclear", "100LL")
# https://www.geeksforgeeks.org/inheritance-and-composition-in-python/ # https://www.geeksforgeeks.org/inheritance-and-composition-in-python/
def __str__(self):
return str(self.vehicleType)
@abstractmethod @abstractmethod
def __init__(self, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid):
self.vehicleObject = Fleet(vtype,movspeed, travelmed, vehicleid) def __init__(self, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType, _vehicleType):
self.gpsPosition = _gpsPosition self.gpsPosition = _gpsPosition
self.velocity = _velocity self.velocity = _velocity
self.velocityType = _weight self.velocityType = _velocityType
self.weightType = _velocityType self.weight = _weight
self.weight = _weightType self.weightType = _weightType
self.status = _status self.status = _status
self.fuelType = _fuelType
self.vehicleType = _vehicleType
def loadCargo(self, _weight):
self.status = "loading cargo"
print(self.status)
class fuelTypes(enum.Enum):
Diesel = 1
Gasoline = 2
Aviation_Kerosene = 3
Electricity = 4
Nuclear = 5
Aviation_Gas = 6
class VehicleTypes(enum.Enum):
# This enum exists to provide easy access to the user creating a new object type
semi_Truck = 1
train = 2
truck = 3
van = 4
car = 5
hovercraft = 6
barge = 7
ship = 8
airplane = 9
helicopter = 10
class GroundVehicleInterface(ABC): class GroundVehicleInterface(ABC):
'''Resource on Python interfaces. This is duck typed. https://realpython.com/python-interface/ Interfaces make a contract that a method must be implemented if an interface is inherited and allows differing implementations of the same method.''' '''Resource on Python interfaces. This is duck typed. https://realpython.com/python-interface/ Interfaces make a contract that a method must be implemented if an interface is inherited and allows differing implementations of the same method.'''
@abstractmethod @abstractmethod
def travel(self): def travel(self):
pass pass
class GroundVehicle(Vehicle, GroundVehicleInterface): class GroundVehicle(Vehicle):
@abstractmethod @abstractmethod
def __init__(self, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid): def __init__(self, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status,vehicleid, _fuelType, _vehicleType):
super().__init__(_gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid) super().__init__(_gpsPosition, _velocity, _weight, _velocityType, _weightType, _status,vehicleid, _fuelType, _vehicleType)
self.isModular = _isModular self.isModular = _isModular
# modifier to GPS position
self.moveGroundVehicle = _moveGroundVehicle self.moveGroundVehicle = _moveGroundVehicle
# modifier to GPS position
class RoadVehicle(GroundVehicle): class RoadVehicle(GroundVehicle):
@abstractmethod @abstractmethod
def __init__(self, _axlecount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid): def __init__(self, _axlecount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType, _vehicleType):
super().__init__(_isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid) super().__init__(_isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType, _vehicleType)
self.axleCount = _axlecount self.axleCount = _axlecount
class Train(GroundVehicle): # Put class specific variables at the end of the constructor/super call
def __init__(self, _noOfCarsAttached, _locomotiveCount): class Train(GroundVehicle, GroundVehicleInterface):
def __init__(self, _noOfCarsAttached, _locomotiveCount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType):
super().__init__(_isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType, VehicleTypes.train)
self.noOfCarsAttached = _noOfCarsAttached self.noOfCarsAttached = _noOfCarsAttached
self.locomotiveCount = _locomotiveCount self.locomotiveCount = _locomotiveCount
@@ -73,32 +91,94 @@ class Train(GroundVehicle):
print(f"The train has {self.locomotiveCount} locomotives attached.") print(f"The train has {self.locomotiveCount} locomotives attached.")
def travel(self): def travel(self):
print("Speed 60mph, Direction E") print("Speed 60mph, Direction E")
def loadCargo(self, _weight, _noOfCarsAttached):
super().loadCargo(_weight)
self.weight = _weight + input(f"Enter cargo weight (integer values only).")
try:
weight = int(weight)
except ValueError:
self.weight = _weight + input(f"That entry was not an integer. Enter cargo weight in integers only.")
Train1 = Train(20, 2)
# Pattern used for loadCargo - https://stackoverflow.com/questions/38987072/how-to-force-integer-input-in-python-3-x
# Train1 = Train(20, 2)
Train1.displayCarCount() # Train1.displayCarCount()
Train1.displayLocomotiveCount() # Train1.displayLocomotiveCount()
# At this point, my code should print out the values from the car count and the locomotive count. Further demonstration of abstract and concrete classes to follow. # At this point, my code should print out the values from the car count and the locomotive count. Further demonstration of abstract and concrete classes to follow.
# Always encapsulate parent constructors into child classes to make those variables available # Always encapsulate parent constructors into child classes to make those variables available
class semi_Truck(RoadVehicle): class semi_Truck(RoadVehicle, GroundVehicleInterface):
def __init__(self, _noOfTrailersAttached, _axlecount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid): def __init__(self, _noOfTrailersAttached, _axlecount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType):
self.noOfTrailersAttached = _noOfTrailersAttached self.noOfTrailersAttached = _noOfTrailersAttached
# super in Python returns an object representing the parent class and # super in Python returns an object representing the parent class and
super().__init__(_axlecount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vtype,movspeed, travelmed, vehicleid) super().__init__(_axlecount, _isModular, _moveGroundVehicle, _gpsPosition, _velocity, _weight, _velocityType, _weightType, _status, vehicleid, _fuelType, VehicleTypes.semi_Truck)
# Don't modify passed in values unless absolutely necessary # Don't modify passed in values unless absolutely necessary
def displaySemiAttributes(self): def displaySemiAttributes(self):
print(f"The semi has {self.noOfTrailersAttached} trailers attached", f"and {self.axleCount} axles.") print(f"The semi has {self.noOfTrailersAttached} trailers attached", f"and {self.axleCount} axles.")
def travel(self): def travel(self):
print(self.status) print(self.status)
def loadCargo(self, _weight):
super().loadCargo(_weight)
# How do I access the set value in the init above?
try:
self.weight = _weight + int(input(f"Enter cargo weight (integer values only)."))
print(f"The semi truck is {self.status}.", f"Cargo weight is {self.weight}.")
except ValueError:
self.weight = _weight + int(input(f"That entry was not an integer. Enter cargo weight in integers only."))
print(f"The semi truck is {self.status}.", f"Cargo weight is {self.weight}.")
# https://realpython.com/factory-method-python/
# Factory method patterns, both standard and polymorphic - https://python-3-patterns-idioms-test.readthedocs.io/en/latest/Factory.html#preventing-direct-creation
class VehicleFactory():
def factory(self, _type):
# try:
if _type == VehicleTypes.semi_Truck:
truckToBuild = semi_Truck(2, 4, True, [40.0000, 50.0000], [30.0000, 20.000], 60, 90000, "mph", "lbs", "traveling", "307UNHL", fuelTypes.Diesel)
return truckToBuild
# Make these parameters and not hard coded values
elif _type == VehicleTypes.train:
return Train(4, 5, True, [40.0000, 50.0000], [30.0000, 20.000], 60, 90000, "mph", "lbs", "traveling", "307UNHL", fuelTypes.Diesel )
else:
print("Bad vehicle creation: " + str(type))
# except TypeError:
# print("Unexpected object creation error")
ShippingFleet = Fleet()
factory1 = VehicleFactory()
SemiTruck1 = factory1.factory(VehicleTypes.semi_Truck)
# print(SemiTruck1)
Train1 = factory1.factory(VehicleTypes.train)
ShippingFleet.addVehicle(Train1)
ShippingFleet.addVehicle(SemiTruck1)
# ShippingFleet.displayAllFleetMembers()
ShippingFleet.displayAllFleetMembers()
# Create object first before asking for input. Then insert object
STruck = semi_Truck(2, 4, True, [40.0000, 40.0000], [56.0000, 89.0000], 60, 90000, "mph", "lbs,", "Ready", "Semi Truck", 100, "Ground", "1F8HNG7") # STruck = semi_Truck(2, 4, True, [40.0000, 40.0000], [56.0000, 89.0000], 60, 90000, "mph", "lbs,", "Ready", "1F8HNG7", "diesel")
# When possible, build your argument requirements from the top down so that by the time you implement your concrete classes, you know all the data points that you need to include. # When possible, build your argument requirements from the top down so that by the time you implement your concrete classes, you know all the data points that you need to include.
# Remember to be careful to check that you are running the method on an instance of the class, not on the class definition. # Remember to be careful to check that you are running the method on an instance of the class, not on the class definition.
STruck.displaySemiAttributes() # STruck.displaySemiAttributes()
# STruck.loadCargo(90000)
# Next - implement abstracted methods and constructor classes. Demonstrate use of super if Python supports it. # Next - implement abstracted methods and constructor classes. Demonstrate use of super if Python supports it.
@@ -106,22 +186,45 @@ STruck.displaySemiAttributes()
# Make vehicle objects, add them to the fleet, and then have displayAllVehicles show the newly added vehicle. Stretch/further off, have different types of vehicles travel regardless of type. # Make vehicle objects, add them to the fleet, and then have displayAllVehicles show the newly added vehicle. Stretch/further off, have different types of vehicles travel regardless of type.
''' '''
Code scratchpad Code scratchpad
For the travel method implemented from the interface For the travel method implemented from the interface
Vehicle.velocity = self.moveGroundVehicle Vehicle.velocity = self.moveGroundVehicle
print("Traveling") print("Traveling")
Object implementation
Semi_Truck1 = semi_Truck(f"This truck has {2} trailers attached", f"and {4} axles.", True, [49.8900000, 50.900000])
# vehicle1 = Fleet("car", 120, "ground", Fleet.vehicles[0])
# vehicle1.displayAllFleetMembers()
# addVehicle = Fleet("hovercraft", 50, "ground/water", 0)
# vehicle1.displayAllFleetMembers()
Error message
Enter cargo weight (integer values only).70000
Traceback (most recent call last):
File "/Users/jason.ross/workspace/python_oop_practice/vehicle_oop_example/fleet.py", line 126, in <module>
STruck.loadCargo(90000)
File "/Users/jason.ross/workspace/python_oop_practice/vehicle_oop_example/fleet.py", line 113, in loadCargo
self.weight = _weight + input(f"Enter cargo weight (integer values only).")
TypeError: unsupported operand type(s) for +: 'int' and 'str'
Scrapped factory class
def inputFunc(self, user_input, listVehicleTypes):
def _listVtypes():
listVehicleTypes = print(map(VehicleTypes))
return listVehicleTypes
user_input = [input("Enter vehicle weight"), ]
return listVehicleTypes, user_input
Object implementation def serialize(self, user_input, inputFunc):
serializer = inputFunc(user_input, VehicleTypes)
Semi_Truck1 = semi_Truck(f"This truck has {2} trailers attached", f"and {4} axles.", True, [49.8900000, 50.900000]) return serializer(user_input)
'''
# vehicle1 = Fleet("car", 120, "ground", Fleet.vehicles[0])
# vehicle1.displayAllFleetMembers()
# addVehicle = Fleet("hovercraft", 50, "ground/water", 0)
# vehicle1.displayAllFleetMembers()
'''