Commit 8a3d8ac2 authored by Georgios Dagkakis's avatar Georgios Dagkakis

added Entity generic class. Part and Frame inherit from it

parent 9529bfd3
# ===========================================================================
# Copyright 2013 Georgios Dagkakis
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 18 Aug 2013
@author: George
'''
'''
Class that acts as an abstract. It should have no instances. All the Entities should inherit from it
'''
#The entity object
class Entity(object):
def __init__(self, name):
self.type="Entity"
self.name=name
self.currentStop=None #contains the current object that the material is in
self.creationTime=0
self.startTime=0 #holds the startTime for the lifespan
#dimension data
self.width=1.0
self.height=1.0
self.length=1.0
\ No newline at end of file
......@@ -28,13 +28,15 @@ models a frame entity. This can flow through the system and carry parts
from SimPy.Simulation import *
from Globals import G
from Entity import Entity
#The entity object
class Frame(object):
class Frame(Entity):
type="Frame"
numOfParts=4 #the number of parts that the frame can take
def __init__(self, name):
self.type="Frame"
self.name=name
self.currentStop=None #contains the current object that the material is in
self.creationTime=0
......
......@@ -29,10 +29,11 @@ models a part entity that flows through the system
from SimPy.Simulation import *
from Globals import G
from Entity import Entity
#The entity object
class Part(object):
class Part(Entity):
type="Part"
def __init__(self, name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment