/*
 * JaamSim Discrete Event Simulation
 * Copyright (C) 2013 Ausenco Engineering Canada Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
package com.jaamsim.CalculationObjects;

import com.jaamsim.input.Output;

/**
 * DoubleCalculation is the super-class for all calculations that return a double.
 * @author Harry King
 *
 */
public abstract class DoubleCalculation extends CalculationEntity {

	private double value;  // Present value for this calculation

	@Override
	public void earlyInit() {
		super.earlyInit();
		value = 0.0;
	}

	/*
	 * Return the present value for this calculation.
	 */
	public double getValue() {
		return value;
	}

	/*
	 * Set the present value for this calculation.
	 */
	protected void setValue( double val ) {
		value = val;
	}

	@Output(name = "Value",
	 description = "The result of the calcuation at the present time.")
	public double getValue( double simTime ) {
		return value;
	}
}

@@ -668,16 +668,154 @@
 .Output;
+%0Aimport com.jaamsim.input.OutputInput;%0Aimport com.sandwell.JavaSimulation.InputErrorException;%0Aimport com.sandwell.JavaSimulation.Keyword;
 %0A%0A/**%0A *
@@ -998,68 +998,727 @@
 %7B%0A%0A%09
-private double value;  // Present value for this calculation
+@Keyword(desc = %22The value to be used as an input to the present calculation.%22,%0A%09         example = %22Calculation1 InputValue %7B Tank-1.FluidLevel %7D%22)%0A%09protected final OutputInput%3CDouble%3E inputValueInput;%0A%0A%09private double value;  // Present value for this calculation%0A%0A%09%7B%0A%09%09inputValueInput = new OutputInput%3CDouble%3E( Double.class, %22InputValue%22, %22Key Inputs%22, null);%0A%09%09this.addInput( inputValueInput, true);%0A%09%7D%0A%0A%09@Override%0A%09public void validate() %7B%0A%09%09super.validate();%0A%0A%09%09// Confirm that the InputValue keyword has been set (unless it is hidden by the sub-class)%0A%09%09if( ! inputValueInput.getHidden() && inputValueInput.getValue() == null ) %7B%0A%09%09%09throw new InputErrorException( %22The InputValue keyword must be set.%22 );%0A%09%09%7D%0A%09%7D
 %0A%0A%09@
@@ -2018,16 +2018,220 @@
 al;%0A%09%7D%0A%0A
+%09@Output(name = %22InputValue%22,%0A%09 description = %22The input to the calculation at the present time.%22)%0A%09public Double getInputValue( double simTime ) %7B%0A%09%09return inputValueInput.getOutputValue( simTime );%0A%09%7D%0A%0A
 %09@Output
@@ -2316,33 +2316,33 @@
 time.%22)%0A%09public 
-d
+D
 ouble getValue( 

Add OutputInput keyword "InputValue" to DoubleCalculation