def create(self, r, r_, R=200):
        '''Create new spirograph image with given arguments. Returned image is
        scaled to agent's preferred image size.
        '''
        x, y = give_dots(R, r, r_, spins=20)
        xy = np.array([x, y]).T
        xy = np.array(np.around(xy), dtype=np.int64)
        xy = xy[(xy[:, 0] >= -250) & (xy[:, 1] >= -250) &
                (xy[:, 0] < 250) & (xy[:, 1] < 250)]
        xy = xy + 250
        img = np.ones([500, 500], dtype=np.uint8)
        img[:] = 255
        img[xy[:, 0], xy[:, 1]] = 0
        img = misc.imresize(img, [self.img_size, self.img_size])
        fimg = img / 255.0
        return fimg
def create ( self , r , r_ , R = 200 ) : x , y = give_dots ( R , r , r_ , spins = 20 ) xy = np . array ( [ x , y ] ) . T xy = np . array ( np . around ( xy ) , dtype = np . int64 ) xy = xy [ ( xy [ : , 0 ] >= - 250 ) & ( xy [ : , 1 ] >= - 250 ) & ( xy [ : , 0 ] < 250 ) & ( xy [ : , 1 ] < 250 ) ] xy = xy + 250 img = np . ones ( [ 500 , 500 ] , dtype = np . uint8 ) img [ : ] = 255 img [ xy [ : , 0 ] , xy [ : , 1 ] ] = 0 img = misc . imresize ( img , [ self . img_size , self . img_size ] ) fimg = img / 255.0 return fimg
Create new spirograph image with given arguments. Returned image is
        scaled to agent's preferred image size.