From 784d7f22fbcbbf84a66b311f7936db9e3f46abd9 Mon Sep 17 00:00:00 2001 From: Sourcery AI Date: Thu, 4 Jun 2020 17:33:54 +0000 Subject: [PATCH] Refactored by Sourcery --- SORAL/python/testbed.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/SORAL/python/testbed.py b/SORAL/python/testbed.py index 38fe1fd..28f531e 100755 --- a/SORAL/python/testbed.py +++ b/SORAL/python/testbed.py @@ -8,14 +8,14 @@ def runTest(): areas=4 resources=1 - + area = soral.doubleArray(areas) POA = soral.doubleArray(areas) ESW = soral.doubleArray(areas) speed = soral.doubleArray(areas) - + # Configure the arrays with some test values - for i in range(0, areas): + for i in range(areas): area[i] = [28, 30, 14, 12][i] POA[i] = [0.1935, 0.2581, 0.2903, 0.2581][i] ESW[i] = 1 @@ -23,35 +23,35 @@ def runTest(): availableHours = soral.doubleArray(resources) availableHours[0] = 40 - + effectiveness = soral.Array2D(areas, resources) - - for resourceIdx in range(0, resources): - for areaIdx in range(0, areas): + + for resourceIdx in range(resources): + for areaIdx in range(areas): value = ESW[areaIdx]*speed[areaIdx]/area[areaIdx] effectiveness.set(areaIdx, resourceIdx, value) # print "Effectiveness("+str(areaIdx)+","+str(resourceIdx)+" = "+str(value); - + theAllocation = soral.newCharnesCooper(resources, areas, effectiveness, availableHours, POA) - + print("The calculated allocation") printAssignments(theAllocation) - + print("PODs: ") - for i in range(0, areas): + for i in range(areas): print(" " +str(i) + ": " + str(theAllocation.getPOD(i))) print("Adjusted POAs: ") - for i in range(0, areas): + for i in range(areas): print(" " +str(i) + ": " + str(theAllocation.getNewPOC(i))) print("Segment POSs: ") - for i in range(0, areas): + for i in range(areas): print(" " +str(i) + ": " + str(theAllocation.getPOS(i))) print(" Cumulative POS: " + str(theAllocation.getTotalPOS()) ) - + del theAllocation