Exemple #1
0
    def __init__(self, name, sim, PD):
        Process.__init__(self, name, sim)
        UsesDriver.__init__(self, PD.driver)
        self.p = PD  # planting device
        self.timeConsumption = {"mounding": 0, "planting": 0, "halting": 0}
        """
		Uptdated:
		None..
		"""
        self.reMoundSignal = SimEvent(name="planthead remounded", sim=self.sim)
        self.reset()
Exemple #2
0
	def __init__(self, sim, driver, machine, name="Bundler"):
		UsesDriver.__init__(self,driver)
		Process.__init__(self, name, sim)
		self.prio=567
		self.color='#CD0000'
		self.m=machine
		self.s=self.m.G.simParam
		self.pos=list(np.array(self.m.pos)+np.array([0,self.s['dropPosJ']]))
		self.timeBundle=self.s['timeBundle']
		self.maxXSection=self.s['maxXSectionJ']
		self.xSectionThresh=self.s['xSectionThreshJ']
		self.currentBundle=None
		self.forceBundler=False #Is set to true when bundler is filled or new pile from head does not fit		
Exemple #3
0
	def __init__(self, name, sim, PD,width=None):
		Process.__init__(self, name, sim)
		UsesDriver.__init__(self, PD.driver)
   		self.p=PD #planting device
		self.length=2*self.p.G.simParam['moundRadius']
		self.depth=self.length*0.5 #radius of hole
		if self.p.G.simParam['wMB'] != None:
			self.width=self.p.G.simParam['wMB']
		else:
			if width==None:
				raise Exception('needs a width for the plantHead. Either give it or set simParam[wMB]')
			self.width=width
		self.timeConsumption={'mounding':0, 'planting':0, 'halting':0, 'inverting':0}
		self.reMoundSignal=SimEvent(name='planthead remounded', sim=self.sim)
		self.reset()
Exemple #4
0
	def __init__(self, name, sim, belongToMachine,G):
		Process.__init__(self, name, sim)
		UsesDriver.__init__(self, belongToMachine.driver)
		Obstacle.__init__(self, [0,0], isSpherical=False, terrain=G.terrain)
		self.m=belongToMachine
		self.G=G
		#cylindrical coordinates in relation to machine:
		#crane starts in its minimum position to the left of the driver.
		#algorithms for planting:
		self.noMoreSpots=False #used to cancel the search for new spots
		self.idealSpots=[]
		self.pSpots=[]
		self.plantHeads=[]
		self.otherDevice = None #defined later if 2a
		self.struckLastTime=False
		self.timeConsumption={'crane movement':0}
		self.moveEvent=SimEvent(name='planthead moves', sim=self.sim)
		if len(self.m.pDevs)==0: #first arm, right, could also be 1a
			self.mountPoint='right'	
		elif len(self.m.pDevs)==1:
			self.mountPoint='left'
		else:
			raise Exception("ERROR: cannot mount more than two planting devices to machine.%f"%len(self.m.pDevs))
		if self.m.headType=='Mplanter':
			self.plantSepDist=self.G.PMplantSepDist
			for lr in ["left", "right"]:
				h=Mplanter(self.name+"_"+lr+"_head", self.sim, PD=self,leftRight=lr)
				self.sim.activate(h,h.run())
				self.plantHeads.append(h)
				self.plantAreaW=self.plantSepDist+h.width
		elif self.m.headType=='Bracke':
			h=Bracke(self.name+"_"+"brackeHead", self.sim, PD=self)
			self.sim.activate(h, h.run())
			self.plantHeads.append(h)
			self.plantAreaW=h.width
		else:
			raise Exception('Headtype not supported: %s'%str(self.headType))
		self.plantAreaL=2*h.length
		self.radius=0.5*sqrt(self.plantAreaW**2+self.plantAreaL**2) #needed for plantingdevice to be regarded as obst.
		#define the optimal nodes:
		self.initOpt()
		self.setPos(self.optNodes[0])
		self.optNode=0
		self.autoMoved=True
		self.sim.machines.append(self)
		self.pSpots.append(self.pos)
		self.plantSignals=0
Exemple #5
0
	def __init__(self, sim, driver, machine, twigCrack):
		UsesDriver.__init__(self,driver)
		ThinningCraneHead.__init__(self, sim, name="BCHead", machine=machine,twigCrack=twigCrack)
		self.road=None #the correct road will be stored here
		self.pos=self.getStartPos()
		self.m.heads[self.side]=self
		self.reset()
		self.maxTreeWeight=self.s['maxWeightCD']#350 #kg
		self.width=self.s['headWidthCD']#1.
		self.corridorWidth=self.width
		self.corrPerSide=self.s['noCorridorsPerSideCD']
		self.length=self.s['headWidthCD']+0.5
		self.timeDropTrees=self.s['timeDropTreesCD']
		self.chopConst=self.s['constFellTreeCD']
		self.velFell=self.s['velocityFellTreeCD']
		self.maxGripArea=self.s['maxGripAreaCD']
		self.automatic={'moveArmIn': self.s['moveArmInCD'],
						'moveArmOut': self.s['moveArmOutCD'],
						'dumpTrees': self.s['dropTreesCD'],
						'chop': self.s['fellTreesCD'],
						'twigCrack': self.s['twigCrackD']}
Exemple #6
0
	def __init__(self, sim, driver, machine, twigCrack):
		UsesDriver.__init__(self,driver)
		ThinningCraneHead.__init__(self, sim, name="ConvHeadAcc", machine=machine, twigCrack=twigCrack)
		self.road=None #the currect road will be stored here
		self.pos=self.getStartPos()
		self.m.heads[self.side]=self
		self.reset()
		self.length=self.s['headWidthEF']#0.5 OBSERVE THAT THIS HEAD IS SET TO BE SQUARE
		self.width=self.s['headWidthEF']#0.5
		self.corridorWidth=self.s['corridorWidthEF']#2
		self.corrPerSide=self.s['noCorridorsPerSideEF']#3
		self.maxTreeWeight=self.s['maxWeightEF']#350 #set it to same as BC...
		self.maxGripArea=self.s['maxGripAreaEF']#0.03#0.28 #[m2]is reasonable: comes from max grip radius of 0.3m
		self.timeDropTrees=self.s['timeDropTreesEF']
		self.chopConst=self.s['constFellTreeEF']
		self.velFell=self.s['velocityFellTreeEF']
		self.maxGripArea=self.s['maxGripAreaEF']
		self.automatic={'moveArmIn': self.s['moveArmInEF'],
						'moveArmOut': self.s['moveArmOutEF'],
						'dumpTrees': self.s['dropTreesEF'],
						'chop': self.s['fellTreesEF'],
						'twigCrack': self.s['twigCrackF']}
Exemple #7
0
	def __init__(self, name, sim, belongToMachine,G):
		Process.__init__(self, name, sim)
		UsesDriver.__init__(self, belongToMachine.driver)
		Obstacle.__init__(self, [0,0], isSpherical=False, terrain=G.terrain)
		self.m=belongToMachine
		self.G=G
		#cylindrical coordinates in relation to machine:
		#crane starts in its minimum position to the left of the driver.
		#algorithms for planting:
		self.noMoreSpots=False #used to cancel the search for new spots
		self.idealSpots=[]
		self.pSpots=[]
		self.plantHeads=[]
		self.otherDevice = None #defined later if 2a
		self.struckLastTime=False
		self.timeConsumption={'crane movement':0}
		self.moveEvent=SimEvent(name='planthead moves', sim=self.sim)
		if len(self.m.pDevs)==0: #first arm, right, could also be 1a
			self.mountPoint='right'	
		elif len(self.m.pDevs)==1:
			self.mountPoint='left'
		else:
			raise Exception("ERROR: cannot mount more than two planting devices to machine.%f"%len(self.m.pDevs))
		if self.m.headType=='Mplanter':
			self.plantSepDist=2.01 #existing machine, constant parameter
			for no in [0,1]:
				#h=Mplanter(self.name+"_"+str(no)+"_head", self.sim, PD=self,leftRight=lr)
				h=Mplanter(self.name+"_"+str(no)+"_head", self.sim, PD=self,number=no)
				self.sim.activate(h,h.run())
				self.plantHeads.append(h)
			self.plantAreaW=self.plantSepDist+h.width
		elif self.m.headType=='MultiHead':
			self.plantSepDist=self.G.simParam['dibbleDist'] #1m by default
			if '3h' in self.m.type:
				no=3
			elif '4h' in self.m.type:
				no=4
			else:
				raise Exception('3 or 4 heads are supported, not more or less, %s'%str(self.m.type))
			for i in range(no):
				h=MultiHead(self.name+"_"+str(i+1)+"_head", self.sim, PD=self,number=i)
				self.sim.activate(h,h.run())
				self.plantHeads.append(h)
			self.plantAreaW=(no-1)*self.plantSepDist+h.width #2*h.width/2..both sides..
		elif self.m.headType=='Bracke':
			h=Bracke(self.name+"_"+"brackeHead", self.sim, PD=self)
			self.sim.activate(h, h.run())
			self.plantHeads.append(h)
			self.plantAreaW=h.width
		else:
			raise Exception('Headtype not supported: %s'%str(self.m.headType))
		self.plantAreaL=2*h.length
		self.radius=0.5*sqrt(self.plantAreaW**2+self.plantAreaL**2) #needed for plantingdevice to be regarded as obst.
		#define the optimal nodes:
		self.initOpt()
		self.setPos(self.optNodes[0])
		self.optNode=0
		self.autoMoved=True
		self.sim.machines.append(self)
		self.pSpots.append(self.pos)
		self.plantSignals=0