Exemple #1
0
 def isEquivalentTo(self, other):
     if type(other) is not RectangularRegion:
         return False
     return (areEquivalent(other.position, self.position)
             and areEquivalent(other.heading, self.heading)
             and areEquivalent(other.width, self.width)
             and areEquivalent(other.height, self.height))
Exemple #2
0
 def isEquivalentTo(self, other):
     if type(other) is not SectorRegion:
         return False
     return (areEquivalent(other.center, self.center)
             and areEquivalent(other.radius, self.radius)
             and areEquivalent(other.heading, self.heading)
             and areEquivalent(other.angle, self.angle))
Exemple #3
0
	def isEquivalentTo(self, other):
		if not type(other) is MethodDistribution:
			return False
		return (self.method == other.method
			and areEquivalent(self.object, other.object)
			and areEquivalent(self.arguments, other.arguments)
			and areEquivalent(self.kwargs, other.kwargs))
Exemple #4
0
	def isEquivalentTo(self, other):
		if not type(other) is FunctionDistribution:
			return False
		return (self.function == other.function
			and areEquivalent(self.arguments, other.arguments)
			and areEquivalent(self.kwargs, other.kwargs)
			and self.support == other.support)
Exemple #5
0
 def isEquivalentTo(self, other):
     if type(other) is not Scenario:
         return False
     return (areEquivalent(other.workspace, self.workspace)
             and areEquivalent(other.objects, self.objects)
             and areEquivalent(other.params, self.params)
             and areEquivalent(other.externalParams, self.externalParams)
             and areEquivalent(other.requirements, self.requirements)
             and other.externalSampler == self.externalSampler)
Exemple #6
0
	def isEquivalentTo(self, other):
		if not type(other) == type(self):
			return False
		return (areEquivalent(self.index, other.index)
		        and areEquivalent(self.options, other.options))
Exemple #7
0
 def isEquivalentTo(self, other):
     if type(other) is not DifferenceRegion:
         return False
     return (areEquivalent(self.regionA, other.regionA)
             and areEquivalent(self.regionB, other.regionB)
             and other.orientation == self.orientation)
Exemple #8
0
	def isEquivalentTo(self, other):
		if not type(other) is Normal:
			return False
		return (areEquivalent(self.mean, other.mean)
			and areEquivalent(self.stddev, other.stddev))
Exemple #9
0
	def isEquivalentTo(self, other):
		if not type(other) is TruncatedNormal:
			return False
		return (areEquivalent(self.mean, other.mean)
			and areEquivalent(self.stddev, other.stddev)
			and self.low == other.low and self.high == other.high)
Exemple #10
0
	def isEquivalentTo(self, other):
		if not type(other) is OperatorDistribution:
			return False
		return (self.operator == other.operator
			and areEquivalent(self.object, other.object)
			and areEquivalent(self.operands, other.operands))
Exemple #11
0
	def isEquivalentTo(self, other):
		if not type(other) is Range:
			return False
		return (areEquivalent(self.low, other.low)
			and areEquivalent(self.high, other.high))
Exemple #12
0
 def isEquivalentTo(self, other):
     if type(other) is not type(self):
         return False
     return areEquivalent(self.allProperties(), other.allProperties())
Exemple #13
0
	def isEquivalentTo(self, other):
		if not type(other) is AttributeDistribution:
			return False
		return (self.attribute == other.attribute
			and areEquivalent(self.object, other.object))
Exemple #14
0
 def isEquivalentTo(self, other):
     if not type(other) == Options:
         return False
     return (areEquivalent(self.options, other.options)
             and self.cumulativeWeights == other.cumulativeWeights)
Exemple #15
0
	def isEquivalentTo(self, other):
		if not type(other) is TupleDistribution:
			return False
		return (areEquivalent(self.coordinates, other.coordinates)
			and self.builder == other.builder)
Exemple #16
0
def tryPickling(thing, checkEquivalence=True):
    pickled = dill.dumps(thing)
    unpickled = dill.loads(pickled)
    if checkEquivalence:
        assert areEquivalent(unpickled, thing)
Exemple #17
0
 def isEquivalentTo(self, other):
     if type(other) is not IntersectionRegion:
         return False
     return (areEquivalent(set(other.regions), set(self.regions))
             and other.orientation == self.orientation)
Exemple #18
0
 def isEquivalentTo(self, other):
     if type(other) is not CircularRegion:
         return False
     return (areEquivalent(other.center, self.center)
             and areEquivalent(other.radius, self.radius))