Select "X" number of Points/items by optimizing two variables?

I am having trouble running an optimization for my program/spatial arrangement script that I am working on (linked).

I am trying to run it through octopus but I can’t figure out how to set the genome/parameters to select objects in a list (or X number of points out of “y” possible points).

Right now, I have the grasshopper script set up dynamically, so that when the program breakdowns are adjusted the code will determine how many facade elements will need to be windows (for housing). I have broken the facade down into a grid and created centroids of each grid point to calculate the total number of facade grids, then the code will output a desired number that should be windows.

Now I want to be able to read the assigned values (in a list form) to each of these points/facade panels and select or optimize the selection such that it outputs a list with the centroids which have both the largest view potential, and the smallest sun potential (so that we can use solar panels elsewhere where there are no windows and these will maximize the amount of energy the building can produce).

I have most of the script completed, I have the two lists that correspond the facade panels for the sun and view analysis, and I have the desired number of points/panels that I want the code to select, and the total number of options for the code to evaluate.

It seems that octopus cannot select items as a list as its output parameter, only produce numbers in a slider or panel format. Do you have any ideas how I can use these 4 inputs (1:desired number of panels/points/items in a list, or “X”, 2:total number items/panels/points, which I am calling “Y” 3: sun study results, and 4:view analysis results) to select the best “x” number of points/items/panels?

Please let me know if you have any ideas on how to progress this further.
GH and Rhino Files
Program Part1.gh (109.3 KB)