Ejemplo n.º 1
0
 def __init__(self, specfile):
     try:
         with open(specfile, 'r') as f:
             if not self.parse_spec(json.loads(f.read())):
                 sys.exit(0)
     except Exception as e:
         print(e)
         sys.exit(0)
     Composite.__init__(self, [1, 1], [1, 1])
Ejemplo n.º 2
0
 def __init__(self, specfile):
     try:
         with open(specfile, 'r') as f:
             if not self.parse_spec(json.loads(f.read())):
                 sys.exit(0)
     except Exception as e:
         print(e)
         sys.exit(0)
     Composite.__init__(self, [1, 1], [1, 1])
Ejemplo n.º 3
0
 def __init__(self, num):
     self._num = num
     
     schema_in = [1] * 2**len(num)
     schema_out = []
     r = len(num) - 1
     while r >= 0:
         schema_out.append(2**r)
         r -= 1
     schema_out.append(1)
     Composite.__init__(self, schema_in, schema_out)
Ejemplo n.º 4
0
    def __init__(self, num):
        self._num = num

        schema_in = [1] * 2**len(num)
        schema_out = []
        r = len(num) - 1
        while r >= 0:
            schema_out.append(2**r)
            r -= 1
        schema_out.append(1)
        Composite.__init__(self, schema_in, schema_out)
Ejemplo n.º 5
0
    def __init__(self, num, rounds):
        self._num = num
        self._rounds = rounds

        schema_in = [1] * 2**rounds
        schema_out = []
        r = rounds - 2
        while r >= 0:
            schema_out.append(2**r)
            schema_out.append(2**r)
            r -= 1
        schema_out += [1, 1]
        Composite.__init__(self, schema_in, schema_out)
Ejemplo n.º 6
0
    def __init__(self, num, rounds):
        self._num = num
        self._rounds = rounds

        schema_in = [1] * 2**rounds
        schema_out = []
        r = rounds - 2
        while r >= 0:
            schema_out.append(2**r)
            schema_out.append(2**r)
            r -= 1
        schema_out += [1, 1]
        Composite.__init__(self, schema_in, schema_out)
Ejemplo n.º 7
0
    def __init__(self, nplayers, num, tie, threshold=1, subgroups=None):
        self._num = num
        self._tie = tie
        self._threshold = threshold

        schema_in = [nplayers]
        schema_out = [1] * nplayers
        Composite.__init__(self, schema_in, schema_out)

        if subgroups != None:
            self._original = False
            self._subgroups = subgroups
        else:
            self._original = True
            self._subgroups = dict()
Ejemplo n.º 8
0
    def __init__(self, nplayers, num, tie, threshold=1, subgroups=None):
        self._num = num
        self._tie = tie
        self._threshold = threshold

        schema_in = [nplayers]
        schema_out = [1] * nplayers
        Composite.__init__(self, schema_in, schema_out)

        if subgroups != None:
            self._original = False
            self._subgroups = subgroups
        else:
            self._original = True
            self._subgroups = dict()
Ejemplo n.º 9
0
 def __init__(self, num):
     self._num = num
     Composite.__init__(self, [1] * 4, [1] * 4)
Ejemplo n.º 10
0
    def __init__(self):
        self._num = 2

        schema_in = [1] * 72
        schema_out = [16, 16, 8, 8, 8, 4, 4, 2, 2, 1, 1, 1, 1]
        Composite.__init__(self, schema_in, schema_out)
Ejemplo n.º 11
0
    def __init__(self):
        self._num = 2

        schema_in = [1] * 72
        schema_out = [16, 16, 8, 8, 8, 4, 4, 2, 2, 1, 1, 1, 1]
        Composite.__init__(self, schema_in, schema_out)
Ejemplo n.º 12
0
 def __init__(self, num):
     self._num = num
     Composite.__init__(self, [1]*4, [1]*4)