tvaLib
Public Member Functions | Public Attributes | List of all members
include.config.PredictionMethod Class Reference

Public Member Functions

def __init__ (self, label, label_short, idx, paramClass, protocol='ccc', prepare=False, kwargs)
 
def setCameraSettings (self, kwargs)
 
def setAccelerationDistribution (self, value)
 
def setSteeringDistribution (self, value)
 
def getPrepare (self)
 
def getPredictionClass (self)
 
def storePredictionClass (self)
 
def prepare (self, args)
 
def export (self, path='')
 
def stripKwargsForUncleanTarget (self, kwargs)
 

Public Attributes

 label
 
 label_short
 
 idx
 
 paramClass
 
 protocol
 
 prepare_
 
 params
 
 predictionClass
 

Detailed Description

Definition at line 448 of file config.py.

Constructor & Destructor Documentation

◆ __init__()

def include.config.PredictionMethod.__init__ (   self,
  label,
  label_short,
  idx,
  paramClass,
  protocol = 'ccc',
  prepare = False,
  kwargs 
)

Definition at line 449 of file config.py.

449  def __init__(self, label, label_short, idx, paramClass, protocol='ccc', prepare=False, **kwargs):
450  self.label = label
451  self.label_short = label_short
452  self.idx = idx
453  self.paramClass = paramClass
454  self.protocol = protocol
455  self.prepare_ = prepare
456  self.params = PredictionParams(protocol=self.protocol, **kwargs)
457  self.predictionClass = None
458 

Member Function Documentation

◆ export()

def include.config.PredictionMethod.export (   self,
  path = '' 
)

Definition at line 475 of file config.py.

475  def export(self, path=''):
476  if(self.predictionClass is not None): return self.predictionClass.export(path=path, **self.params.getParamDict())
477  return False
478 

◆ getPredictionClass()

def include.config.PredictionMethod.getPredictionClass (   self)

Definition at line 465 of file config.py.

465  def getPredictionClass(self):
466  if(self.predictionClass is not None): return self.predictionClass
467  return self.paramClass(**self.stripKwargsForUncleanTarget(self.params.getParamDict()))
468 

◆ getPrepare()

def include.config.PredictionMethod.getPrepare (   self)

Definition at line 463 of file config.py.

463  def getPrepare(self): return self.prepare_
464 

◆ prepare()

def include.config.PredictionMethod.prepare (   self,
  args 
)

Definition at line 471 of file config.py.

471  def prepare(self, *args):
472  if(self.predictionClass is None): self.storePredictionClass()
473  return self.predictionClass.prepare(*args, **self.params.getParamDict())
474 

◆ setAccelerationDistribution()

def include.config.PredictionMethod.setAccelerationDistribution (   self,
  value 
)

Definition at line 460 of file config.py.

460  def setAccelerationDistribution(self, value): self.params.setAccelerationDistribution(value)

◆ setCameraSettings()

def include.config.PredictionMethod.setCameraSettings (   self,
  kwargs 
)

Definition at line 459 of file config.py.

459  def setCameraSettings(self, **kwargs): return self.params.setCameraSettings(**kwargs)

◆ setSteeringDistribution()

def include.config.PredictionMethod.setSteeringDistribution (   self,
  value 
)

Definition at line 461 of file config.py.

461  def setSteeringDistribution(self, value): self.params.setSteeringDistribution(value)
462 

◆ storePredictionClass()

def include.config.PredictionMethod.storePredictionClass (   self)

Definition at line 469 of file config.py.

469  def storePredictionClass(self): self.predictionClass = self.getPredictionClass()
470 

◆ stripKwargsForUncleanTarget()

def include.config.PredictionMethod.stripKwargsForUncleanTarget (   self,
  kwargs 
)

Definition at line 479 of file config.py.

479  def stripKwargsForUncleanTarget(self, kwargs):
480  if(len(kwargs) <= 0): return {}
481  from inspect import getargspec as inspect_getargspec
482  args = inspect_getargspec(self.paramClass.__init__)
483  for kwarg in kwargs:
484  if(not kwarg in args.args):
485  kwargs[kwarg] = None
486  return dict((k, v) for k, v in kwargs.iteritems() if v)
487 
488 
def stripKwargsForUncleanTarget(kwargs, func)
Function tools.
Definition: tools.py:238

Member Data Documentation

◆ idx

include.config.PredictionMethod.idx

Definition at line 452 of file config.py.

◆ label

include.config.PredictionMethod.label

Definition at line 450 of file config.py.

◆ label_short

include.config.PredictionMethod.label_short

Definition at line 451 of file config.py.

◆ paramClass

include.config.PredictionMethod.paramClass

Definition at line 453 of file config.py.

◆ params

include.config.PredictionMethod.params

Definition at line 456 of file config.py.

◆ predictionClass

include.config.PredictionMethod.predictionClass

Definition at line 457 of file config.py.

◆ prepare_

include.config.PredictionMethod.prepare_

Definition at line 455 of file config.py.

◆ protocol

include.config.PredictionMethod.protocol

Definition at line 454 of file config.py.


The documentation for this class was generated from the following file: