Set initial centers. Should be set before calling trainOn.
193298
def setInitialCenters(self, centers, weights):
        
        self._model = StreamingKMeansModel(centers, weights)
        return self
1052221
@Override
    public synchronized void initialize(Settings settings) {
        super.initialize(settings);
        setEnabled(checkEnabled());
        numberOfRetries = getSettings().getInt(Settings.KEYS.ANALYZER_CENTRAL_RETRY_COUNT, numberOfRetries);
    }
86689
private void setMeanDistancesToCentroids() {
        meanDistancesToCentroids = new HashMap<>();
        for (int i = 0; i < clusterCentroids.numInstances(); i++) {    //For each centroid
            int countAssignedInstances = 0;
            double sumDistancesToCentroid = 0.0;
            Instance centroidInstance = clusterCentroids.instance(i);
            for (int j = 0; j < trainingData.numInstances(); j++) {       //For each data point
                 if (i == centroidAssignments[j]) {
                     Instance valueInstance = trainingData.instance(j);
                     double distanceToCentroid = Math.abs(valueInstance.value(0) -
                                                    centroidInstance.value(0));
                     sumDistancesToCentroid += distanceToCentroid;
                     countAssignedInstances++;
                 }
            }
            double meanDistanceToCentroid = sumDistancesToCentroid / countAssignedInstances;
            meanDistancesToCentroids.put(centroidInstance, meanDistanceToCentroid);
        }
    }
292913
protected void findCenter() {
        center = new float[]{0, 0};
        int length = points.length;
        for(int i=0;i<length;i+=2) {
            center[0] += points[i];
            center[1] += points[i + 1];
        }
        center[0] /= (length / 2);
        center[1] /= (length / 2);
    }
866477
@Override
    public void setCenter(final IGeoPoint point) {
        // If no layout, delay this call
        if (!mMapView.isLayoutOccurred()) {
            mReplayController.setCenter(point);
            return;
        }
        mMapView.setExpectedCenter(point);
    }
1131746
def center(self):
        '''
        
        '''
        return Point(self.midX, self.midY, self.origin.z)
461919
def setPoint(self, targetTemp):
        """"""
        self.targetTemp = targetTemp
        self.Integrator = 0
        self.Derivator = 0
738288
public void setCenter(Point2D center)
    {
        Point2D old = this.getCenter();

        double centerX = center.getX();
        double centerY = center.getY();

        Dimension mapSize = getTileFactory().getMapSize(getZoom());
        int mapHeight = (int) mapSize.getHeight() * getTileFactory().getTileSize(getZoom());
        int mapWidth = (int) mapSize.getWidth() * getTileFactory().getTileSize(getZoom());

        if (isRestrictOutsidePanning())
        {
            Insets insets = getInsets();
            int viewportHeight = getHeight() - insets.top - insets.bottom;
            int viewportWidth = getWidth() - insets.left - insets.right;

            // don't let the user pan over the top edge
            Rectangle newVP = calculateViewportBounds(center);
            if (newVP.getY() < 0)
            {
                centerY = viewportHeight / 2;
            }

            // don't let the user pan over the left edge
            if (!isHorizontalWrapped() && newVP.getX() < 0)
            {
                centerX = viewportWidth / 2;
            }

            // don't let the user pan over the bottom edge
            if (newVP.getY() + newVP.getHeight() > mapHeight)
            {
                centerY = mapHeight - viewportHeight / 2;
            }

            // don't let the user pan over the right edge
            if (!isHorizontalWrapped() && (newVP.getX() + newVP.getWidth() > mapWidth))
            {
                centerX = mapWidth - viewportWidth / 2;
            }

            // if map is to small then just center it vert
            if (mapHeight < newVP.getHeight())
            {
                centerY = mapHeight / 2;// viewportHeight/2;// - mapHeight/2;
            }

            // if map is too small then just center it horiz
            if (!isHorizontalWrapped() && mapWidth < newVP.getWidth())
            {
                centerX = mapWidth / 2;
            }
        }

        // If center is outside (0, 0,mapWidth, mapHeight)
        // compute modulo to get it back in.
        {
            centerX = centerX % mapWidth;
            centerY = centerY % mapHeight;

            if (centerX < 0)
                centerX += mapWidth;

            if (centerY < 0)
                centerY += mapHeight;
        }

        GeoPosition oldGP = this.getCenterPosition();
        this.center = new Point2D.Double(centerX, centerY);
        firePropertyChange("center", old, this.center);
        firePropertyChange("centerPosition", oldGP, this.getCenterPosition());
        repaint();
    }
1368976
public void setCenterProperties(Point3d center1) {
		this.center.setProperties(center1.xProperty, center1.yProperty, center1.zProperty);
	}
1102008
def gen_centers(self):
        """"""

        '''x_track = self.cs.discrete_rollout()
        t = np.arange(len(x_track))*self.dt
        # choose the points in time we'd like centers to be at
        c_des = np.linspace(0, self.cs.run_time, self.bfs)
        self.c = np.zeros(len(c_des))
        for ii, point in enumerate(c_des): 
            diff = abs(t - point)
            self.c[ii] = x_track[np.where(diff == min(diff))[0][0]]'''

        # desired spacings along x
        # need to be spaced evenly between 1 and exp(-ax)
        # lowest number should be only as far as x gets 
        if self.bfs == 2:
            first = 0.5 # MODIFIED to handle a small number of basis (e.g. 3)
            last = 0.8
        elif self.bfs == 3:
            first = 0.4
            last = 0.8
        else:
            first = 0.2
            last = 0.8
        #first = np.exp(-self.cs.ax*self.cs.run_time) 
        #last = 1.05 - first
        des_c = np.linspace(first,last,self.bfs) 

        self.c = np.ones(len(des_c)) 
        for n in range(len(des_c)): 
            # x = exp(-c), solving for c
            self.c[n] = -np.log(des_c[n])
890951
public void setCenterProperties(Point3d center) {
		this.cxProperty = center.xProperty;
		this.cyProperty = center.yProperty;
		this.czProperty = center.zProperty;
	}
718183
public void setFrameFromCenter (float centerX, float centerY,
                                    float cornerX, float cornerY) {
        float width = Math.abs(cornerX - centerX);
        float height = Math.abs(cornerY - centerY);
        setFrame(centerX - width, centerY - height, width * 2, height * 2);
    }
1226933
def set_initial(self, C_in, scale_in, scale_high):
        """
        self.C_in = C_in
        self.scale_in = scale_in
        self.scale_high = scale_high
187321
def gen_centers(self):
        """"""

        c = np.linspace(0, 2*np.pi, self.bfs+1)
        c = c[0:-1]
        self.c = c
246668
private void setActiveCenters(IAtomContainer reactant) throws CDKException {
        Iterator<IBond> bonds = reactant.bonds().iterator();
        while (bonds.hasNext()) {
            IBond bondi = bonds.next();
            IAtom atom1 = bondi.getBegin();
            IAtom atom2 = bondi.getEnd();
            if (bondi.getOrder() == IBond.Order.SINGLE
                    && (atom1.getFormalCharge() == CDKConstants.UNSET ? 0 : atom1.getFormalCharge()) == 0
                    && (atom2.getFormalCharge() == CDKConstants.UNSET ? 0 : atom2.getFormalCharge()) == 0
                    && reactant.getConnectedSingleElectronsCount(atom1) == 0
                    && reactant.getConnectedSingleElectronsCount(atom2) == 0) {
                bondi.setFlag(CDKConstants.REACTIVE_CENTER, true);
                atom1.setFlag(CDKConstants.REACTIVE_CENTER, true);
                atom2.setFlag(CDKConstants.REACTIVE_CENTER, true);
            }
        }
    }
970904
def _center(code, segment_dict):
    """"""
    while code in segment_dict:
        segment = segment_dict[code]
        yield segment
        code = segment.center
472648
public void setProperties(Point3d center, DoubleProperty radius1) {
		setProperties(center.xProperty,center.yProperty,center.zProperty, radius1);
	}