コード例 #1
0
ファイル: HorizontalGrid.py プロジェクト: agold/svgchart
	def __init__(self, points=(), left=0.0, right=1.0,
				start=0.0, end=1.0,
				id=u'', classes=(),
				lineidprefix=u'', lineclasses=()):
		"""
		@param points: A sequence of points to draw grid lines at
		@param left: The leftmost coordinate to begin drawing grid lines at
		@param right: The rightmost coordinate to stop drawing grid lines at

		@param start: The starting coordinate of the axis
		@param end: The ending coordinate of the axis
		
		@param id: The unique ID to be used in the SVG document
		@type id: string
		@param classes: Classnames to be used in the SVG document
		@type classes: string or sequence of strings

		@param lineidprefix: The prefix for each grid line's ID
		@type lineidprefix: string
		@param lineclasses: Classnames to be applied to each grid line
		@type lineclasses: string or sequence of strings
		"""

		Grid.__init__(self, points, start, end, id, classes, lineidprefix, lineclasses)

		self.left = left
		self.right = right
コード例 #2
0
    def __init__(self, data, param):
        Grid.__init__(self, data, param)

        self.param.m = self.param.partitionsHTree[1]
        self.param.maxHeightHTree = 2

        logging.debug("Grid_pure: size: %d" % self.param.m)
コード例 #3
0
ファイル: VerticalGrid.py プロジェクト: agold/svgchart
    def __init__(self,
                 points=(),
                 top=0.0,
                 bottom=1.0,
                 start=0.0,
                 end=1.0,
                 id=u'',
                 classes=(),
                 lineidprefix=u'',
                 lineclasses=()):
        """
		@param points: A sequence of points to draw grid lines at
		@param top: The top coordinate to begin drawing grid lines at
		@param bottom: The bottom coordinate to stop drawing grid lines at

		@param start: The starting coordinate of the axis
		@param end: The ending coordinate of the axis
		
		@param id: The unique ID to be used in the SVG document
		@type id: string
		@param classes: Classnames to be used in the SVG document
		@type classes: string or sequence of strings

		@param lineidprefix: The prefix for each grid line's ID
		@type lineidprefix: string
		@param lineclasses: Classnames to be applied to each grid line
		@type lineclasses: string or sequence of strings
		"""

        Grid.__init__(self, points, start, end, id, classes, lineidprefix,
                      lineclasses)

        self.top = top
        self.bottom = bottom
コード例 #4
0
ファイル: Grid_pure.py プロジェクト: ubriela/geocrowd-priv
    def __init__(self, data, param):
        Grid.__init__(self, data, param)

        self.param.m = self.param.partitionsHTree[1]
        self.param.maxHeightHTree = 2

        logging.debug("Grid_pure: size: %d" % self.param.m)
コード例 #5
0
ファイル: Grid_standard.py プロジェクト: infolab-usc/BDR
    def __init__(self, data, param):
        Grid.__init__(self, data, param)

        self.param.m = self.param.part_size
        self.param.maxHeightHTree = 2

        logging.debug("Grid_standard: size: %d" % self.param.m)
コード例 #6
0
ファイル: solve.py プロジェクト: tushartuteja/wordamentsolver
 def __init__(self, height, width, grid=None):
     Grid.__init__(self, height, width)
     if grid is not None:
         i = 1
         for line in grid:
             j = 1
             for item in line:
                 self.set_element(i, j, item)
                 j += 1
         i += 1
コード例 #7
0
    def __init__(self, raw_grid):
        Grid.__init__(self, raw_grid)
        # Inherits Grid class
        self.number_of_iterations_yet = 0
        self.gamma = 0.7
        # gamma : discount factor

        self.errant_probability = 0.1
        # two errant outcomes
        self.intended_probability = 0.8
コード例 #8
0
    def __init__(self, program, xmax, ymax):
        # Color options
        self.__black = 0
        self.__white = 1

        # Location
        self.location = [0, 0]

        IntCode.__init__(self, program)
        Direction.__init__(self)
        Grid.__init__(self, xmax=xmax, ymax=ymax, default=self.__black)
コード例 #9
0
ファイル: HexagonalGrid.py プロジェクト: butakun/duh
	def __init__(self, shape):

		Grid.__init__(self, shape)

		Grid.Name = "Hexagonal"

		# Set up the rotated coordinate system
		# See http://www-acaps.cs.mcgill.ca/~clump/hexes.txt
		self.Coord = n.zeros((shape[0], shape[1], 2), int)
		for i in range(shape[0]):
			for j in range(shape[1]):
				self.Coord[i, j, :] = (i, j)
		for i in range(shape[0]):
			self.Coord[i, :, 1] += i / 2
コード例 #10
0
    def __init__(self, *args, **kwargs):
        Grid.__init__(self, *args, **kwargs)

        # style
        self._size_palette = {
            "cell": 60,
            "border": 10,
            "marker": 40,
            "ruler": 30
        }
        self._color_palette = {"bg": "white", "obstacle": "black"}

        # other
        self._basic_image = None  # will be saved the first time generated
        self._rulers_image = None  # will be saved the first time generated
        self._ruler_font = ImageFont.truetype(
            "arial.ttf", int(self._size_palette["ruler"] * 0.9))
コード例 #11
0
ファイル: GUI.py プロジェクト: lumidify/BobGUI
 def __init__(self, **kwargs):
     pygame.init()
     self.screen_info = pygame.display.Info()
     self.screen_size = kwargs.get("screen_size", (0, 0))
     self.resizable = kwargs.get("resizable", True)
     if self.resizable:
         self.screen = pygame.display.set_mode(self.screen_size, RESIZABLE)
     else:
         self.screen = pygame.display.set_mode(self.screen_size)
     self.rect = Rect((0, 0), self.screen.get_size())
     self.layout = kwargs.get("layout", None)
     if self.layout == "grid":
         Grid.__init__(self)
         self.layout = Grid
     elif self.layout == "flow":
         Flow.__init__(self)
         self.layout = Flow
     elif self.layout == "place" or self.layout is None:
         Place.__init__(self)
         self.layout = Place
     self.fullscreen = kwargs.get("fullscreen", False)
     self.last_screen_size = self.rect.size
コード例 #12
0
    def __init__(self):
        Grid.__init__(self)
        self.node_name = 'MASCOT'
        rospy.init_node(self.node_name, anonymous=True)
        self.rate = rospy.Rate(1)  # 1Hz
        self.auv_handler = AuvHandler(self.node_name, "MASCOT")

        rospy.Subscriber("/Vehicle/Out/Temperature_filtered", Temperature,
                         self.TemperatureCB)
        rospy.Subscriber("/Vehicle/Out/Salinity_filtered", Salinity,
                         self.SalinityCB)
        rospy.Subscriber("/Vehicle/Out/EstimatedState_filtered",
                         EstimatedState, self.EstimatedStateCB)

        self.speed = 1.6  # m/s
        self.depth = 0.0  # meters
        self.last_state = "unavailable"
        self.rate.sleep()
        self.init = True
        self.currentTemperature = 0.0
        self.currentSalinity = 0.0
        self.vehicle_pos = [0, 0, 0]
        self.surfacing = False
        self.surfacing_time = 25  # surface time, [sec]
コード例 #13
0
ファイル: GridFrame.py プロジェクト: lumidify/BobGUI
 def __init__(self, parent, **kwargs):
     Widget.__init__(self, parent)
     Grid.__init__(self)
     self.rect = Rect(0, 0, kwargs.get("width", 0), kwargs.get("height", 0))
コード例 #14
0
 def __init__(self):
     "Inicializando variáveis."
     Grid.__init__(self)
コード例 #15
0
ファイル: CartesianGrid.py プロジェクト: butakun/duh
    def __init__(self, shape):

        Grid.__init__(self, shape)
        self.Name = "Cartesian"