Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Enabled Parallelization code and commented out non-parallel code and
fixed a few typos
  • Loading branch information
Tony authored and Tony committed Dec 9, 2015
1 parent 859f38a commit a2a29a2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Binary file not shown.
Binary file modified jOptJSRecover/bin/jopt/js/spi/graph/arc/ForwardCheckArc.class
Binary file not shown.
Binary file modified jOptJSRecover/bin/jopt/js/spi/graph/arc/ForwardCheckReflexArc.class
Binary file not shown.
Binary file modified jOptJSRecover/bin/jopt/js/spi/variable/JsVarFactory.class
Binary file not shown.
Expand Up @@ -207,7 +207,7 @@ public class DiscreteResourceDomain extends ResourceDomain {
}
}

int maxValue = 0;
/* int maxValue = 0;
for (int i=0; i<indices.size(); i++) {
index = indices.get(i);
int val = worthes.get(i);
Expand Down Expand Up @@ -236,9 +236,9 @@ public class DiscreteResourceDomain extends ResourceDomain {
}
}
}

*/

/*// Modified code for adding in parallel capabilities
// Modified code for adding in parallel capabilities



Expand Down Expand Up @@ -306,7 +306,7 @@ public class DiscreteResourceDomain extends ResourceDomain {
}

// End Parallelization
*/



return maxValue;
Expand Down
10 changes: 5 additions & 5 deletions jOptJSRecover/src/jopt/js/spi/graph/arc/ForwardCheckArc.java
Expand Up @@ -37,7 +37,7 @@ public class ForwardCheckArc extends SchedulerArc {
}
Arrays.sort(targetIDs);
this.targets = new ResourceNode[targets.length];

/*
//(Non-parallel implementation) This will ensure that resources are ordered for fast easy access later
for (int i=0; i<targetIDs.length; i++) {
for (int j=0; j<targets.length; j++) {
Expand All @@ -46,19 +46,19 @@ public class ForwardCheckArc extends SchedulerArc {
break;
}
}
}
}*/


// Parallelization implementation Begins
// - Creates an object that will split the task of the above code into separate tasks.



/* ForkSplit target_loop = new ForkSplit(0, targetIDs.length,targets,targetIDs,this.targets);
ForkSplit target_loop = new ForkSplit(0, targetIDs.length,targets,targetIDs,this.targets);
ForkJoinPool target_pool = new ForkJoinPool();
target_pool.invoke(target_loop);
this.targets = target_loop.get_main_targets(); // Will grab the targets object from forking
*/
this.targets = target_loop.get_main_vars(); // Will grab the targets object from forking


// Parallelization implementation End

Expand Down
Expand Up @@ -37,7 +37,7 @@ public class ForwardCheckReflexArc extends SchedulerArc {
Arrays.sort(sourceIDs);
this.sources= new ResourceNode[sources.length];

//(Non-parallel implementation) This will ensure that resources are ordered for fast and easy access later
/* //(Non-parallel implementation) This will ensure that resources are ordered for fast and easy access later
for (int i=0; i<sourceIDs.length; i++) {
for (int j=0; j<sources.length; j++) {
if (sourceIDs[i] == sources[j].getID()) {
Expand All @@ -46,17 +46,17 @@ public class ForwardCheckReflexArc extends SchedulerArc {
}
}
}

*/

// Parallelization implementation
// - Creates an object that will split the task of the above code into separate tasks.


/* ForkSplit source_loop = new ForkSplit(0,sourceIDs.length,sources,sourceIDs, this.sources);
ForkSplit source_loop = new ForkSplit(0,sourceIDs.length,sources,sourceIDs, this.sources);
ForkJoinPool source_pool = new ForkJoinPool();
source_pool.invoke(source_loop);
this.sources = source_loop.get_main_targets();
*/
this.sources = source_loop.get_main_vars();


// Parallelization end

Expand Down
8 changes: 4 additions & 4 deletions jOptJSRecover/src/jopt/js/spi/variable/JsVarFactory.java
Expand Up @@ -115,7 +115,7 @@ public class JsVarFactory extends VarFactory implements JsVariableFactory {

int index = offset;

// (Non - Parallel Implementation) //
/* // (Non - Parallel Implementation) //
for (int i=1; i<capacity.length; i++) {
for (int j=0; j<4; j++) {
if (index<neoCapacity.length) {
Expand All @@ -125,18 +125,18 @@ public class JsVarFactory extends VarFactory implements JsVariableFactory {
}
}

*/


// Parrallelization Process

/*

ForkSplit_NeoCap neocap_loop = new ForkSplit_NeoCap(index, index + 4*(capacity.length-1),
neoCapacity,capacity,1,capacity.length);
ForkJoinPool neocap_join = new ForkJoinPool();
neocap_join.invoke(neocap_loop);

*/

// End Parrallelization Process


Expand Down

0 comments on commit a2a29a2

Please sign in to comment.