예제 #1
0
 def __init__(self, **kwargs):
     Matter.__init__(self, **kwargs)
     self.accepted_kwargs = {'world': None,
                             'coordinate_key': '0_0_0',
                             'impassible': True,
                             'layer': 1.2,
                             'float_offset': plist([0.5, 0.5]), 
                             'controllable': False
                                            }
     for key in self.accepted_kwargs.keys():
         if key in kwargs.keys():
             self.__setattr__(key, kwargs[key])
         else:
             self.__setattr__(key, self.accepted_kwargs[key]) 
     #Render related local variables..
     self.width   = sprite_manifest[self.image_key].frame_width
     self.height  = sprite_manifest[self.image_key].frame_height
     self.tall    = self.height
     self.frame = 0 #the rendered last frame in a "strip" of frames
     self.facing = 5
     self.pixel_offsets = self.determine_pixel_offset()
     #Thresholds for changes in milliseconds
     #Thresholds for changes in milliseconds
     self.move_threshold  = 500
     self.frame_threshold = self.move_threshold/5
     self.tick_accumulator = 0
     self.move_accumulator = 0
     self.path = None
예제 #2
0
 def __init__(self, **kwargs):
     Matter.__init__(self, **kwargs)
     self.accepted_kwargs = {'tall': 0, 'float_offset': plist([0.5, 0.5]), 'layer': 1.5,
                             'frame': (0, 0), 'weight' : 0.0, 'use_sound' : 'explosion.ogg'}
     for key in self.accepted_kwargs.keys():
         if key in kwargs.keys():
             self.__setattr__(key, kwargs[key])
         else:
             self.__setattr__(key, self.accepted_kwargs[key])
예제 #3
0
파일: solution.py 프로젝트: OhEvolve/RANDY
    def __init__(self, *args, **kwargs):
        """ Initialization of object """

        self.volume = '0 mL'  # volume of solution

        Matter.__init__(self, *args, **kwargs)  # update with arguments

        self.update(*args, **kwargs)  # update object attributes

        self.features += ['volume']  # add printed attributes
예제 #4
0
 def __init__(self, **kwargs):
     Matter.__init__(self, **kwargs)
     self.accepted_kwargs = {'speedModifier': 1.0, 'layer': 0.1, 'pathable': True}
     for key in self.accepted_kwargs.keys():
         if key in kwargs.keys():
             self.__setattr__(key, kwargs[key])
         else:
             self.__setattr__(key, self.accepted_kwargs[key])
     #No Tiles offset. Would create gaps. Only here as placeholder values.
     self.float_offset = plist([0.0,0.0])
     self.pixel_offsets = plist([0, 0])
예제 #5
0
    def __init__(self,*args,**kwargs):
        """ Initialization of object """

        self.species = ''                                      # species of population
        self.count = 0                                         # cell count
        self.contents = [Sequence(name='gDNA',form='genomic')] # contents of cell

        Matter.__init__(self)                                  # update with arguments

        self.update(*args,**kwargs)                            # update object attributes

        self.features += ['species','count']                   # add printed attributes
예제 #6
0
파일: buffer.py 프로젝트: OhEvolve/RANDY
    def __init__(self, *args, **kwargs):
        """ Initialization of object """
        self.contents = []  # list to fill with matter
        self.instructions = ''  # preparation instructions
        self.reagents = {}  # reagents log

        Matter.__init__(self)  # update with arguments
        Mixture.__init__(self)  # update with arguments

        self.update(*args, **kwargs)  # update object attributes

        # list of features to print out on call
        self.features += ['instructions']
예제 #7
0
    def __init__(self, *args, **kwargs):
        """ Initialization of object """
        self.container = ''  # container for sample
        self.contents = []  # list to fill with matter

        Matter.__init__(self)  # update with arguments
        Mixture.__init__(self)  # update with arguments

        self.update(*args, **kwargs)  # update object attributes

        self.volume = self.volume

        # list of features to print out on call
        self.features += ['container']
예제 #8
0
    def __init__(self, *args, **kwargs):
        """ Initialization of object """

        self.sequence = ''  # species of population
        self.codon_set = 'standard'  # codon set (only supported: standard)
        self.elements = {}  # elements to display in your sequence
        self.material = 'dsDNA'  # dsDNA,ssDNA,dsRNA,ssRNA
        self.form = 'plasmid'  # plasmid,genomic
        self.shape = 'linear'  # linear,circular

        Matter.__init__(self)  # add class features
        Solute.__init__(self)  # add class features

        self.update(*args, **kwargs)  # update object attributes

        self.features += ['material', 'total_volume']  # add printed attributes
예제 #9
0
 def __init__(self, **kwargs):
     Matter.__init__(self, **kwargs)
     self.accepted_kwargs = {'tall': 0,
                                               'float_offset': plist([0.5, 0.5]),
                                               'float_offset_ranges': plist(((0.25, 0.75),(0.25, 0.75))),
                                               'speed_modifier': 1.0,
                                               'layer': 1.0,
                                               'impassible': False,
                                               'blocksLOS': False 
                                             }
     for key in self.accepted_kwargs.keys():
         if key in kwargs.keys():
             self.__setattr__(key, kwargs[key])
         else:
             self.__setattr__(key, self.accepted_kwargs[key])
     self.pixel_offsets = self.determine_pixel_offset()
예제 #10
0
    def __init__(self,*args,**kwargs):
        """ Initialization of object """

        self.molecular_weight = 0                        # molecular weight

        self._mass          = 0                          # mass of solute
        self._moles         = 0                          # mols of solute
        self._total_volume  = 0                          # hidden variable, for translating conc.

        self._concentration = 0                          # mass/volume of solute
        self._molarity      = 0                          # mols/volume of solute

        Matter.__init__(self)                            # update with arguments

        self.update(*args,**kwargs)                      # update object attributes

        # add printed attributes
        self.features += ['molecular_weight','mass','moles','concentration','molarity']