A PROCEDURE FOR THE AUTOMATIC SCHEDULING OF DISTRIBUTED ENERGY RESOURCES IN MEDIUM VOLTAGE NETWORKS