/*
 * 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.Keyword;
import com.sandwell.JavaSimulation.DoubleListInput;

/**
 * The Polynomial entity returns a user-defined polynomial function of its input value.
 * @author Harry King
 *
 */
public class Polynomial extends DoubleCalculation {

	@Keyword(description = "The list of coefficients for the polynomial function.  For example, inputs c0, c1, c2 give a polynomial" +
			" P(x) = c0 + c1*x^2 + c2*x^3 ",
	         example = "Polynomial1 CoefficientList { 2.0  1.5 }")
	private final DoubleListInput coefficientListInput;

	{
		coefficientListInput = new DoubleListInput( "CoefficientList", "Key Inputs", null);
		this.addInput( coefficientListInput, true);
	}

	@Override
	public void update(double simTime) {

		// Calculate the weighted sum
		double x = this.getInputValue(simTime);
		double pow = 1.0;
		double val = 0.0;
		for(int i=0; i<coefficientListInput.getValue().size(); i++ ) {
			val += coefficientListInput.getValue().get(i) * pow;
			pow *= x;
		}

		// Set the present value
		this.setValue( val );
		return;
	}
}

@@ -1175,21 +1175,16 @@
 ientList
-Input
 ;%0A%0A%09%7B%0A%09%09
@@ -1198,21 +1198,16 @@
 ientList
-Input
  = new D
@@ -1294,21 +1294,16 @@
 ientList
-Input
 , true);
@@ -1495,37 +1495,32 @@
 %3CcoefficientList
-Input
 .getValue().size
@@ -1556,21 +1556,16 @@
 ientList
-Input
 .getValu

Rename input objects for Polynomial