I am facing a problem in my project. I have different types of controller that provide different input and output ports. I have the number of required points. I need some code that generate the number of controllers and types depending on the required point + some spare points that should be assigned as like the cheapest combination.
For example, I have a system that requires :
- digital output point = 8
- analog output point = 2
- digital input point = 15
- analog input points = 4
and what I need is to spare 15% on each input/output :
What I have is:
- controller 1 providing :
- 3 digital inputs
- 2 analog outputs
- 10 digital outputs
- 4 analog inputs
- controller 2 providing:
- 2 digital inputs
- 1 analog output
- 3 digital outputs
- 3 analog inputs
The price of controller 1 is 200$ and the price of controller 2 is 120$.
How can I start programming this code either on excel or using javascript?