public ObservableSemantics withType(IConcept type) { ObservableSemantics ret = new ObservableSemantics(this); ret.setType(type); return ret; }
@Override public boolean select(IKnowledge o) { return NS.isEvent(o); } };
/** * True if o1 and o2 are observables from recognized domains, have compatible context * and inherency, o1 is o2, and o1 adopts all the traits and roles that o2 adopts. * * @param o1 * @param o2 * @return */ public static boolean isCompatible(IConcept o1, IConcept o2) { return isCompatible(o1, o2, 0); }
/** * True if observable has a stated context (mandatory for qualities) and context * isCompatible with the stated context for observable. * * @param observable * @param context * @return */ public static boolean isContextCompatible(IConcept observable, IConcept context) { IConcept ctx = getContextType(observable); return ctx != null && isCompatible(context, ctx); }
public ObservableSemantics withInterpretingTrait(IConcept interpretAs) throws KlabValidationException { if (interpretAs != null) { return withType(Observables .declareObservable((IConcept) getType(), Collections .singleton(interpretAs), null, null)); } return this; }
public String getExportFileName() { String ret = CamelCase.toLowerCase(NS.getDisplayName(getType()), '_'); if (observingSubjectId != null) { ret = observingSubjectId + "_" + ret; } return ret; }
static public double[] LatLonToUTMXY(double lat, double lon, int zone) { double[] xy = MapLatLonToXY(lat, lon, UTMCentralMeridian(zone)); /* Adjust easting and northing for UTM system. */ xy[0] = xy[0] * UTMScaleFactor + 500000.0; xy[1] = xy[1] * UTMScaleFactor; if (xy[1] < 0.0) xy[1] = xy[1] + 10000000.0; return xy; }
@Override public boolean select(IKnowledge o) { return NS.isThing(o); } };
public KIMDirectObserver(INamespace namespace, IConcept observable, String id, IScale scale) { super(namespace, id); this.observable = new ObservableSemantics(observable); this.scale = scale; }
@Override public boolean select(IKnowledge o) { return NS.isQuality(o); } };
@Override public boolean select(IKnowledge o) { return NS.isProcess(o); } };
static public double[] UTMXYToLatLon(double x, double y, int zone, boolean southhemi) { x -= 500000.0; x /= UTMScaleFactor; /* If in southern hemisphere, adjust y accordingly. */ if (southhemi) y -= 10000000.0; y /= UTMScaleFactor; double cmeridian = UTMCentralMeridian(zone); return MapXYToLatLon(x, y, cmeridian); }
public void setForcing(double size, String unit) { forcingSize = size; forcingUnit = new Unit(unit); }
public Collection<IKnowledge> getAllPhysicalProperties() { return filter(new ObservableFilter() { @Override public boolean select(IKnowledge o) { return o.is(KLAB.c(NS.CORE_PHYSICAL_PROPERTY)); } }); }
Collection<Triple<IConcept, IConcept, IProperty>> getRoles() { if (roles == null) { roles = NS.getSemanticDependencies(mainType); } return roles; }
@Override protected IConcept getObservedType(KIMScope context, IConcept knowledge) { valuedObservable = knowledge; return Observables.makeValue(knowledge, this.comparisonConcept); }
public boolean isEventHandler() { if (isEventHandler == null) { isEventHandler = false; for (IConcept c : domain) { if (NS.isEvent(c)) { isEventHandler = true; break; } } } return isEventHandler; }
static public double[] LatLonToUTMXY(double lat, double lon) { double[] xy = MapLatLonToXY(lat, lon, UTMCentralMeridian(0)); /* Adjust easting and northing for UTM system. */ xy[0] = xy[0] * UTMScaleFactor + 500000.0; xy[1] = xy[1] * UTMScaleFactor; if (xy[1] < 0.0) xy[1] = xy[1] + 10000000.0; return xy; }