コード例 #1
0
 def __init__(self, controlSpace, objective, metric, edgeChecker, **params):
     """Given a ControlSpace controlSpace, a metric, and an edge checker"""
     TreePlanner.__init__(self)
     self.controlSpace = controlSpace
     if not isinstance(controlSpace, ControlSpace):
         print "Warning, controlSpace is not a ControlSpace"
     if not isinstance(edgeChecker, EdgeChecker):
         print "Warning, edgeChecker is not an EdgeChecker"
     self.cspace = controlSpace.configurationSpace()
     self.metric = metric
     self.objective = objective
     self.edgeChecker = edgeChecker
     self.controlSelector = RandomControlSelector(controlSpace, self.metric,
                                                  1)
     self.goal = None
     self.goalSampler = None
     self.pChooseGoal = popdefault(params, 'pChooseGoal', 0.1)
     self.goalNodes = []
     self.selectionRadius = popdefault(params, 'selectionRadius', 0.1)
     self.witnessRadius = popdefault(params, 'witnessRadius', 0.03)
     self.witnessSet = []
     self.configurationSampler = Sampler(
         self.controlSpace.configurationSpace())
     nnmethod = popdefault(params, 'nearestNeighborMethod', 'kdtree')
     self.nearestNeighbors = NearestNeighbors(self.metric, nnmethod)
     self.nearestWitness = NearestNeighbors(self.metric, nnmethod)
     self.stats = Profiler()
     self.numIters = self.stats.count('numIters')
     self.bestPathCost = infty
     self.bestPath = None
     if len(params) != 0:
         print "Warning, unused params", params
コード例 #2
0
    def __init__(self,controlSpace,objective,metric,edgeChecker,
                 **params):
        """Given a ControlSpace controlSpace, a metric, and an edge checker"""
        TreePlanner.__init__(self)
        self.controlSpace = controlSpace
	if not isinstance(controlSpace,ControlSpace):
            print "Warning, controlSpace is not a ControlSpace"
	if not isinstance(edgeChecker,EdgeChecker):
            print "Warning, edgeChecker is not an EdgeChecker"
        self.cspace = controlSpace.configurationSpace()    
        self.metric = metric
        self.objective = objective
        self.edgeChecker = edgeChecker
	self.controlSelector = RandomControlSelector(controlSpace,self.metric,1)
        self.goal = None
        self.goalSampler = None
        self.pChooseGoal = popdefault(params,'pChooseGoal',0.1)
        self.goalNodes = []
        self.selectionRadius = popdefault(params,'selectionRadius',0.1)
        self.witnessRadius = popdefault(params,'witnessRadius',0.03)
        self.witnessSet = []
        self.configurationSampler = Sampler(self.controlSpace.configurationSpace())        
        nnmethod = popdefault(params,'nearestNeighborMethod','kdtree')
        self.nearestNeighbors = NearestNeighbors(self.metric,nnmethod)
        self.nearestWitness = NearestNeighbors(self.metric,nnmethod)
        self.stats = Profiler()
        self.numIters = self.stats.count('numIters')
        self.bestPathCost = infty
        self.bestPath = None
        if len(params) != 0:
            print "Warning, unused params",params
コード例 #3
0
 def __init__(self,controlSpace,objective,metric,edgeChecker,
              **params):
     self.selectionRadius0 = popdefault(params,'selectionRadius',0.2)
     self.witnessRadius0 = popdefault(params,'witnessRadius',0.2)
     self.numIters0 = popdefault(params,'numSSTIters',300)
     self.shrinkage = popdefault(params,'shrinkage',0.8)
     self.ssrrt = StableSparseRRT(controlSpace,objective,metric,
                                  edgeChecker,selectionRadius=self.selectionRadius0,witnessRadius=self.witnessRadius0,**params)
     self.itersleft = self.numIters0
     self.stats = Profiler()
     self.stats.items['ssrrt'] = self.ssrrt.stats
     self.numIters = self.stats.count('numIters')
     self.restartCount = self.stats.count('restartCount')
     self.bestPath = None
     self.bestPathCost = infty
     if len(params) != 0:
         print "Warning, unused params",params
コード例 #4
0
 def __init__(self, controlSpace, objective, metric, edgeChecker, **params):
     self.selectionRadius0 = popdefault(params, 'selectionRadius', 0.2)
     self.witnessRadius0 = popdefault(params, 'witnessRadius', 0.2)
     self.numIters0 = popdefault(params, 'numSSTIters', 300)
     self.shrinkage = popdefault(params, 'shrinkage', 0.8)
     self.ssrrt = StableSparseRRT(controlSpace,
                                  objective,
                                  metric,
                                  edgeChecker,
                                  selectionRadius=self.selectionRadius0,
                                  witnessRadius=self.witnessRadius0,
                                  **params)
     self.itersleft = self.numIters0
     self.stats = Profiler()
     self.stats.items['ssrrt'] = self.ssrrt.stats
     self.numIters = self.stats.count('numIters')
     self.restartCount = self.stats.count('restartCount')
     self.bestPath = None
     self.bestPathCost = infty
     if len(params) != 0:
         print "Warning, unused params", params
コード例 #5
0
    def __init__(self,cspace,metric,edgeChecker,
                 **params):
        """Given a ControlSpace controlSpace, a metric, and an edge checker"""
        TreePlanner.__init__(self)
	if not isinstance(cspace,ConfigurationSpace):
		print "Warning, cspace is not a ConfigurationSpace"
	if not isinstance(edgeChecker,EdgeChecker):
		print "Warning, edgeChecker is not an EdgeChecker"
        self.cspace = cspace
        self.metric = metric
        self.edgeChecker = edgeChecker
        self.goal = None
        self.goalSampler = None
        self.pChooseGoal = popdefault(params,'pChooseGoal',0.1)
        self.goalNodes = []
        self.configurationSampler = Sampler(self.cspace)
        nnmethod = popdefault(params,'nearestNeighborMethod','kdtree')
        self.nearestNeighbors = NearestNeighbors(self.metric,nnmethod)
        self.numIters = 0
        self.bestPathCost = infty
        self.bestPath = None
        if len(params) != 0:
            print "Warning, unused params",params