summaryrefslogtreecommitdiffstats
path: root/Monitoring/src/main/python/Example/Dimensions.py.old
diff options
context:
space:
mode:
Diffstat (limited to 'Monitoring/src/main/python/Example/Dimensions.py.old')
-rw-r--r--Monitoring/src/main/python/Example/Dimensions.py.old42
1 files changed, 42 insertions, 0 deletions
diff --git a/Monitoring/src/main/python/Example/Dimensions.py.old b/Monitoring/src/main/python/Example/Dimensions.py.old
new file mode 100644
index 0000000..526ee11
--- /dev/null
+++ b/Monitoring/src/main/python/Example/Dimensions.py.old
@@ -0,0 +1,42 @@
+'''
+Created on Oct 12, 2011
+
+@author: steger
+@summary: Here we declare some unit models to enable parameter conversions
+'''
+from DataProcessing.Dimension import DimensionManager
+from Example.Units import UM
+from DataProcessing.MeasurementLevel import Nominal, Interval, Ratio
+
+DM = DimensionManager(unitmanager = UM)
+
+basedimensions = [
+ ("Cardinal", "unitless", Nominal),
+ ("NameOfSomething", "unitless", Nominal),
+ ("Countable", "piece", Ratio),
+ ("InformationSize", "bit", Ratio),
+ ("IPAddress", "ipv4dotted", Nominal),
+ ("PointInTime", "unixtimestamp", Interval),
+ ]
+
+deriveddimensions = [
+ ("TimeInterval", "second", "PointInTime", DM.DifferenceDimension),
+ ("Probability", "fraction", "Countable", DM.RatioDimension),
+ ]
+
+for reference, unitreference, measurementlevel in basedimensions:
+ DM.newBaseDimension(reference, reference, UM[unitreference], measurementlevel)
+
+for reference, unitreference, ancestorreference, dimtype in deriveddimensions:
+ DM.newDerivedDimension(reference, reference, UM[unitreference], DM[ancestorreference], dimtype)
+
+
+#Some dimensions explicitely references
+nameofsomething = DM["NameOfSomething"]
+pointintime = DM["PointInTime"]
+timeinterval = DM["TimeInterval"]
+cardinal = DM["Cardinal"]
+countable = DM["Countable"]
+ipaddress = DM["IPAddress"]
+informationsize = DM["InformationSize"]
+probability = DM["Probability"]