We might need to implement the RNG ourselves as well, depending on the possibilities offered by Substrate out of the box, so maybe another issue will be created regarding this task.
Access the array of the subset of nodes (S), or at least the size of this array (size of the subset) from within the function. Might require to add a parameter to allow to pass this value to the function.
Implement the createServices function as explained in the PoI whitepaper.
Pseudo-code for reference :
See also : this page
Possible challenges :