org.unizone.source

Type Correlation

org.unizone.0.4080
Instance of Type
Inheriting from SourceAdapterMultipleTimeseries

Type dataValue
org.uninode.Type.displayPattern{att:org.unizone.source.Source.displayName}
org.unizone.source.Source.valueAttribute
org.uninode.Resource.resourceType
org.uninode.Resource.label
org.uninode.Resource.resourceOfList{}
org.uninode.Listable.resourcesReference[org.uninode.Listable.resources] of org.unizone.source.Correlation

Attribute summaryDefined inUninode® IdPropertiesDefault
Reference[org.uninode.Listable.resources]resourcesListableorg.uninode.0.2001type
StringtoString
This is the display string.
Nodeorg.uninode.0.102
Typetype
The type of an object determines the behaviour and attributes of the object.
Nodeorg.uninode.0.101
StringuriNodeorg.uninode.0.103
StringlabelResourceorg.uninode.0.2041type
List[Type]resourceOfResourceorg.uninode.0.2042type
SignatureresourceType
This defines the type of resource. It can be 'view', 'adapter' or 'action'
Resourceorg.uninode.0.2043type
StringdisplayName
The display name is the name that is shown in lists, displays and graphs.
Sourceorg.unizone.0.4001essential
AttributevalueAttribute
The value attribute is used for determining the default value that should be used for displaying this source in a graph.
Sourceorg.unizone.0.4011type
inheritValue
SignaturevalueType
The value type determines which axes should be used in graphs.
Sourceorg.unizone.0.4002inheritValue
List[Source]sourcesSourceAdapterMultipleorg.unizone.0.4031

Method summaryDefined inOverridesProperties
voidactivateListable
voidcheckRangeSourceAdapterMultipleSource
voiddesignEditor(WidgetWorkspace ws)Listable
voidgenerateScript(ScriptGenerationInfo info)SourceAdapterMultipleScriptGenerator
Realget(DateTime timestamp)SourceAdapterMultipleTimeseries
BooleanisResourceOf(Listable listable, Signature aspect)Mixabletype
ListablemixOn(Mixable mix)Mixable
ListablemixWith(Mixable mix)Mixable
voidput(DateTime timestamp, Real value)SourceAdapterMultipleTimeseries
StringresourceStringListableintrospection
voidcom.nodelab.java.source.ActivateSourceListable
Listablecom.nodelab.java.source.MixWithMiSourceMixable

Script summary
org.unizone.0.8547
/*
instance Source src1;
instance Source src2;
instance Value[Int] days;

constructor() {
  TimeBuffer:();
  instance days = new Value(Int, 30);
}
Void setDays(Int days) {
  instance days.set(days);
}
class Boolean isResourceOf(Listable node, Symbol aspect) {
  if (aspect == #adaptors) return true;
  false;
}
class String resourceLabel() {
  "correlation";
}
String resourceString() {
  instance days.toString + " days correlation (" + 
    instance src1.toString + ", " + instance src2.toString + ")";
}
Symbol valueType() {
  #correlation
}
Void designEditor(WidgetWorkspace ws) {
  ws.addLabel(new Place(0, 0).setPadding(5, 5), "Days");
  ws.addField(new Place(1, 0).setPadding(20, 5), instance days, null);
}
Mixable mixWith(Mixable item) {
  instance src1 = Producer.mix(1);
  addNextSource(instance src1);
  instance src2 = Producer.mix(0);
  addNextSource(instance src2);
  this;
}
trace TimeData createData(Time t, Symbol resolution) {
  t.toString;
  Producer.report("Preparing " + toString() + " at " + t.toString);
  external cond_history_from = t.addDays(-instance days.value);
  external cond_history_to = t;
  external cond_history_resolution = #day;
  Set[Time] dates = new Set(Time);
  instance src1.collectSteps(#cond_history, dates);
  instance src2.collectSteps(#cond_history, dates);
  if (dates.size < 2) return;
  Array[Real] ar1 = new Array(Real, dates.size - 1);
  Array[Real] ar2 = new Array(Real, dates.size - 1);
  Real val1 = null;
  Real val2 = null;
  Time time = null;
  Real trailVal1 = null;
  Real trailVal2 = null;
  Time trailTime = null;
  0 .to(dates.size - 2, trace Void(Int i) {
    trailVal1 = val1;
    trailVal2 = val2;
    trailTime = time;
    time = dates.at(i);
    external cond_history = time;
    val1 = instance src1.aspectReal(#value);
    val2 = instance src2.aspectReal(#value);
    if (val1 != null && val2 != null && trailVal1 != null && trailVal2 != null) {
      Int span = time.subtractDate(trailTime);
      if (span > 0) {
        ar1.set(i, (val1 - trailVal1) / (span / 365) ^ 0.5);
        ar2.set(i, (val2 - trailVal2) / (span / 365) ^ 0.5);
      } else {
        time = trailTime;
        val1 = trailVal1;
        val2 = trailVal2;
      }
    }
  });
  TimeData data = new TimeData(this, time);
  data.setAspect(#value, Math.correlationMinusOne(ar1, ar2, 0));
  Producer.report("");
  data;
}

*/