Example #1
0
 def __init__(self):
     objs1 = tg.Select(color=sg.random_color(), when=sg.random_when())
     a2 = sg.random_shape()
     a1 = tg.GetShape(objs1)
     if random.random() > 0.5:
         self._operator = tg.IsSame(a1, a2)
     else:
         self._operator = tg.IsSame(a2, a1)
Example #2
0
    def __init__(self):
        color1, color2 = sg.sample_color(2)
        objs1 = tg.Select(color=color1, when=sg.random_when())
        objs2 = tg.Select(color=color2, when=sg.random_when())
        shape11 = tg.GetShape(objs1)
        shape21 = tg.GetShape(objs2)
        shape12, shape22 = sg.random_shape(), sg.random_shape()
        if random.random() > 0.5:
            bool1 = tg.IsSame(shape11, shape12)
        else:
            bool1 = tg.IsSame(shape11, shape12)
        if random.random() > 0.5:
            bool2 = tg.IsSame(shape21, shape22)
        else:
            bool2 = tg.IsSame(shape21, shape22)

        self._operator = tg.And(bool1, bool2)
Example #3
0
    def __init__(self):
        color1, color2 = sg.sample_color(2)
        when1 = sg.random_when()
        a2 = sg.random_shape()
        shape1, shape2 = sg.sample_shape(2)

        objs1 = tg.Select(color=color1, when=when1)
        a1 = tg.GetShape(objs1)

        if random.random() > 0.5:
            bool1 = tg.IsSame(a1, a2)
        else:
            bool1 = tg.IsSame(a2, a1)

        objs2 = tg.Select(color=color2, shape=shape1)
        objs3 = tg.Select(color=color2, shape=shape2)
        go1 = tg.Go(objs2)
        go2 = tg.Go(objs3)
        self._operator = tg.Switch(bool1, go1, go2, both_options_avail=True)
Example #4
0
    def generate_objset(self, n_epoch, n_distractor=1, average_memory_span=2):
        """Generate object set."""
        if n_epoch < 4:
            raise ValueError(
                'Number of epoch {:d} is less than 4'.format(n_epoch))
        shape1, shape2 = sg.sample_shape(2)
        shape3 = sg.random_shape()

        objset = sg.ObjectSet(n_epoch=n_epoch)

        sample1 = sg.Object([self._color1, shape1], when='now')
        distractor1 = sg.Object([self._color3, shape3], when='now')
        test1 = sg.Object([self._color2, shape1], when='now')
        test2 = sg.Object([self._color2, shape2], when='now')

        objset.add(sample1, epoch_now=1)  # sample epoch
        objset.add(distractor1, epoch_now=2)  # delay epoch
        objset.add(test1, epoch_now=3)  # test epoch
        objset.add(test2, epoch_now=3)  # test epoch
        return objset
Example #5
0
 def __init__(self):
     self._shape1 = sg.random_shape()
     objs1 = tg.Select(shape=self._shape1, when='now')
     color1 = tg.GetColor(objs1)
     objs2 = tg.Select(color=color1, shape=self._shape1, when='last1')
     self._operator = tg.Exist(objs2)
Example #6
0
 def __init__(self):
     color1 = sg.random_color()
     shape1 = sg.random_shape()
     when1 = sg.random_when()
     objs1 = tg.Select(color=color1, shape=shape1, when=when1)
     self._operator = tg.Go(objs1)
Example #7
0
 def __init__(self):
     shape1 = sg.random_shape()
     when1 = sg.random_when()
     objs1 = tg.Select(shape=shape1, when=when1)
     self._operator = tg.Go(objs1)
Example #8
0
 def __init__(self):
     objs1 = tg.Select(shape=sg.random_shape(), when='now')
     self._operator = tg.Exist(objs1)
Example #9
0
 def __init__(self):
     when = sg.random_when()
     shape = sg.random_shape()
     objs1 = tg.Select(shape=shape, when=when)
     self._operator = tg.GetColor(objs1)