package ua.ansymo.hintco

class InterpolationAdaptedPort extends ApproximationAdaptedPort {
	
	new(String pId, AdaptedFMUInstance f) {
		super(pId, f)
	}
	
	override computeReal(double t, double dt, double h, double H) {
		var o = current_val
		if (inCosimStepMode){
			o = previous_val + ((current_val - previous_val)/H)*(dt+h)
		}
		fmu.setInnerReal(portId, o)
	}
	
}