public void SLearning() {
        for(Integer c: activeColumns.get(time)) {
            for(Synapse s: potentialSynapses.get(c)) {
                if (input(time, s.c, s.i) > 0) {
                    s.permanence += permanenceInc;
                    s.permanence = Math.min(s.permanence, 1.0);
                } else {
                    s.permanence -= permanenceDec;
                    s.permanence = Math.max(s.permanence, 0.0);
                }
            }
        }

        for(int i=0;i<xDimension*yDimension;i++) {
            minDutyCycle[i] = 0.01 * maxDutyCycle(neighbours(i));
            activeDutyCycle[i] = updateActiveDutyCycle(i);
            boost[i] = boostFunction(activeDutyCycle[i], minDutyCycle[i]);
            overlapDutyCycle[i] = updateOverlapDutyCycle(i);

            if (overlapDutyCycle[i] < minDutyCycle[i]) {
                increasePermanences(i, 0.1*connectedPerm);
            }
        }

        inhibitionRadius = averageReceptiveFieldSize();
    }