Constructor method
constructor({mix, council, userInput} = {})
This constructs a new instance of the calculator object.
For a more detailed example please visit the demo repo
Example:
// Please see detailed example
// for more information on how these variable can be acquired.
const userInput = {
acres: 50,
plantingDate: '11/27/2021',
soilDrainage: ["Well Drained", "Excessively Drained" ]
// this can also include any of the parameters needed for other functions.
};
const council = 'mccc';
const mix = [crop1, crop2, crop3];
const calculator = new SeedRateCalculator({mix, council, userInput});
Parameters
mix (Array|Object) : Required
The mix parameter should be an array of crops, or a crop object. The crop objects MUST either be an instantiated instance of a Crop Class, or an object containing a valid schema to create an instance of the Crop Class.
council (string) : Required
The council parameter is required, and must be in the list of Supported Councils above. The council is not case sensitive, but must be represented in the acronym format.
userInput (Object) : Optional
The userInput parameter is where you can pass in optional user input parameters to customize the mix.
Returns (Object)
SeedRateCalculator Instance