src/nupic/algorithms/backtracking_tm_cpp.py
def getSegmentOnCell(self, c, i, segIdx):
    """
    Overrides :meth:`nupic.algorithms.backtracking_tm.BacktrackingTM.getSegmentOnCell`.
    """
    segList = self.cells4.getNonEmptySegList(c,i)
    seg = self.cells4.getSegment(c, i, segList[segIdx])
    numSyn = seg.size()
    assert numSyn != 0

    # Accumulate segment information
    result = []
    result.append([int(segIdx), bool(seg.isSequenceSegment()),
                   seg.getPositiveActivations(),
                   seg.getTotalActivations(), seg.getLastActiveIteration(),
                   seg.getLastPosDutyCycle(),
                   seg.getLastPosDutyCycleIteration()])

    for s in xrange(numSyn):
      sc, si = self.getColCellIdx(seg.getSrcCellIdx(s))
      result.append([int(sc), int(si), seg.getPermanence(s)])

    return result
def getSegmentOnCell(self, c, i, segIdx):
    """
    Overrides :meth:`nupic.algorithms.backtracking_tm.BacktrackingTM.getSegmentOnCell`.
    """
    segList = self.cells4.getNonEmptySegList(c,i)
    seg = self.cells4.getSegment(c, i, segList[segIdx])
    numSyn = seg.size()
    assert numSyn != 0

    # Accumulate segment information
    result = []
    result.append([int(segIdx), bool(seg.isSequenceSegment()),
                   seg.getPositiveActivations(),
                   seg.getTotalActivations(), seg.getLastActiveIteration(),
                   seg.getLastPosDutyCycle(),
                   seg.getLastPosDutyCycleIteration()])

    for s in xrange(numSyn):
      sc, si = self.getColCellIdx(seg.getSrcCellIdx(s))
      result.append([int(sc), int(si), seg.getPermanence(s)])

    return result
def getSegmentOnCell ( self , c , i , segIdx ) : segList = self . cells4 . getNonEmptySegList ( c , i ) seg = self . cells4 . getSegment ( c , i , segList [ segIdx ] ) numSyn = seg . size ( ) assert numSyn != 0 # Accumulate segment information result = [ ] result . append ( [ int ( segIdx ) , bool ( seg . isSequenceSegment ( ) ) , seg . getPositiveActivations ( ) , seg . getTotalActivations ( ) , seg . getLastActiveIteration ( ) , seg . getLastPosDutyCycle ( ) , seg . getLastPosDutyCycleIteration ( ) ] ) for s in xrange ( numSyn ) : sc , si = self . getColCellIdx ( seg . getSrcCellIdx ( s ) ) result . append ( [ int ( sc ) , int ( si ) , seg . getPermanence ( s ) ] ) return result
Overrides :meth:`nupic.algorithms.backtracking_tm.BacktrackingTM.getSegmentOnCell`.
Overrides : meth : nupic . algorithms . backtracking_tm . BacktrackingTM . getSegmentOnCell .