def toJson(self): """ @return: a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' attrName = "_ASGCKnowledge__alphas" attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) attrName = "_ASGCKnowledge__grids" attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) attrName = "_ASGCKnowledge__iteration" attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") # print "j-------------------------------------------" # print "{" + s + "}" # print "j-------------------------------------------" return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' # serialize for attrName in ('_name', '_value', '_trans'): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) # serialize dist if self.isUncertain(): attrName = "_dist" attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) return "{" + serializationString.rstrip(",\n") + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' # serialize for attrName in ('_name', '_value'): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) # serialize dist if self.isUncertain(): attrName = "_dist" attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) return "{" + serializationString.rstrip(",\n") + "}"
def toJson(self): serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in dir(self): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in ["_Lognormal__mu", "_Lognormal__sigma", "_Lognormal__a", "_Lognormal__b"]: attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ @return: string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in dir(self): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) for attrName in dir(self.__specification): attrValue = self.__specification.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") # print "j-------------------------------------------" # print "{" + s + "}" # print "j-------------------------------------------" return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in ("_LinearTransformation__a", "_LinearTransformation__b"): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in dir(self): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' attrName = "_dist" attrValue = self._dist serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' # serialize for attrName in ('_Sample__activeUnit', '_Sample__activeProb', '_Sample__expandedUnit', '_Sample__expandedProb'): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) return "{" + serializationString.rstrip(",\n") + "}"
def toJson(self): """ Returns a string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName, attrValue in [ ("bounds", self.bounds), ("params", self.params), ]: serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object Arguments: Return A string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in dir(self): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ @return: string that represents the object """ raise NotImplementedError() serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName in dir(self): attrValue = self.__getattribute__(attrName) serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") # print( "j-------------------------------------------" ) # print( "{" + s + "}" ) # print( "j-------------------------------------------" ) return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object Arguments: Return A string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName, attrValue in [ ("_KDEDist__kernelType", str(self.dist.getKernel().getType())), ("_KDEDist__bandwidths", self.getBandwidths()), ("_KDEDist__trainData", self.trainData), ("_KDEDist__bounds", self.bounds) ]: serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object Arguments: Return A string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName, attrValue in [("_SGDEdist__grid", self.grid), ("_SGDEdist__alpha", self.alpha), ("_SGDEdist__trainData", self.trainData), ("_SGDEdist__config", self.config), ("_SGDEdist__bounds", self.bounds), ("_SGDEdist__unitIntegrand", self.unitIntegrand), ]: serializationString += ju.parseAttribute(attrValue, attrName) s = serializationString.rstrip(",\n") return "{" + s + "}"
def toJson(self): """ Returns a string that represents the object Arguments: Return A string that represents the object """ serializationString = '"module" : "' + \ self.__module__ + '",\n' for attrName, attrValue in [("_JointTransformation__ixs", self.__ixs), ("_JointTransformation__n", self.__n)]: serializationString += ju.parseAttribute(attrValue, attrName) # serialize transformations attrName = "_JointTransformation__trans" attrValue = self.__getattribute__(attrName) x = [trans.toJson() for trans in attrValue] x = ['"' + str(i) + '": ' + str(xi) for i, xi in enumerate(x)] serializationString += '"' + attrName + '": {' + ', '.join(x) + '}' return "{" + serializationString + "} \n"