Esempio n. 1
0
    def __init__(self,
                 uid,
                 FeatureType,
                 PredictedType,
                 TargetType,
                 ExtInfo=EmptyInfo):
        assert issubclass(FeatureType, Structure)
        assert issubclass(PredictedType, Structure)
        assert issubclass(TargetType, Structure)
        assert issubclass(ExtInfo, Structure)

        self.m_id = uid
        self.featureType = FeatureType
        self.predictedType = PredictedType
        self.targetType = TargetType
        self.extInfo = ExtInfo
        self.finished = False

        class StorageType(Structure):
            _pack_ = 1
            _fields_ = [('feat', self.featureType),
                        ('pred', self.predictedType), ('tar', self.targetType),
                        ('ext', self.extInfo), ('isFinish', c_bool)]

        self.type = StorageType
        self.m_obj = self.type.from_address(
            RegisterMemory(self.m_id, sizeof(self.type)))
        self.mod = 2
        self.res = 1
Esempio n. 2
0
 def __init__(self, uid, structType):
     assert issubclass(structType, Structure)
     self.m_id = uid
     self.m_dataType = structType
     self.m_obj = self.m_dataType.from_address(
         RegisterMemory(self.m_id, sizeof(self.m_dataType)))
     self.mod = 2
     self.res = 1
Esempio n. 3
0
    def __init__(self, uid, EnvType, ActType, ExtInfo=EmptyInfo):
        assert issubclass(EnvType, Structure)
        assert issubclass(ActType, Structure)
        assert issubclass(ExtInfo, Structure)

        self.m_id = uid
        self.envType = EnvType
        self.actType = ActType
        self.extInfo = ExtInfo

        class StorageType(Structure):
            _pack_ = 1
            _fields_ = [('env', self.envType), ('act', self.actType),
                        ('ext', self.extInfo), ('isFinish', c_bool)]

        self.type = StorageType
        self.m_obj = self.type.from_address(
            RegisterMemory(self.m_id, sizeof(self.type)))
        self.mod = 2
        self.res = 1
Esempio n. 4
0
    def __init__(self, uid, EnvType, ActType, ExtInfo=EmptyInfo):
        assert issubclass(EnvType, Structure)
        assert issubclass(ActType, Structure)
        assert issubclass(ExtInfo, Structure)

        self.m_id = uid
        self.envType = EnvType
        self.actType = ActType
        self.extInfo = ExtInfo
        self.finished = False

        # the main field for RL
        class StorageType(Structure):
            _pack_ = 1
            _fields_ = [('env', self.envType), ('act', self.actType),
                        ('ext', self.extInfo), ('isFinish', c_bool)]

        self.type = StorageType
        self.m_obj = self.type.from_address(
            RegisterMemory(self.m_id, sizeof(
                self.type)))  # allocate from shared memory to create object
        self.mod = 2
        self.res = 1