-
Notifications
You must be signed in to change notification settings - Fork 205
[PEx] Revamps tracking unexplored choices, changes schedule choice #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
122dc53
[PEx] Change schedule choice from PMachine to PMachineId
aman-goel 53c5d15
[PEx] Major revamping of Choice: 1/n
aman-goel c6d87ed
Revert "[PEx] Major revamping of Choice: 1/n"
aman-goel 20f0216
[PEx] Separates unexplored choices from schedule
aman-goel 9c9e7d0
[PEx] Cleanup and minor corrections to recent changes to SearchTask
aman-goel d8d9e7e
[PEx] Minor correction
aman-goel 33c6ff3
[PEx] Corrections to new backtracking logic
aman-goel 82b298c
Merge branch 'dev/pexplicit_checker' into dev/aman
aman-goel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| import lombok.Setter; | ||
| import pexplicit.commandline.PExplicitConfig; | ||
| import pexplicit.runtime.machine.PMachine; | ||
| import pexplicit.runtime.machine.PMachineId; | ||
| import pexplicit.runtime.scheduler.Scheduler; | ||
| import pexplicit.runtime.scheduler.explicit.strategy.SearchStrategyMode; | ||
|
|
||
|
|
@@ -60,19 +61,18 @@ public class PExplicitGlobal { | |
| /** | ||
| * Get a machine of a given type and index if exists, else return null. | ||
| * | ||
| * @param type Machine type | ||
| * @param idx Machine index | ||
| * @param pid Machine pid | ||
| * @return Machine | ||
| */ | ||
| public static PMachine getGlobalMachine(Class<? extends PMachine> type, int idx) { | ||
| List<PMachine> machinesOfType = machineListByType.get(type); | ||
| public static PMachine getGlobalMachine(PMachineId pid) { | ||
| List<PMachine> machinesOfType = machineListByType.get(pid.getType()); | ||
| if (machinesOfType == null) { | ||
| return null; | ||
| } | ||
| if (idx >= machinesOfType.size()) { | ||
| if (pid.getTypeId() >= machinesOfType.size()) { | ||
| return null; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When would this be the case? Should we instead throw an exception?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| PMachine result = machineListByType.get(type).get(idx); | ||
| PMachine result = machineListByType.get(pid.getType()).get(pid.getTypeId()); | ||
| assert (machineSet.contains(result)); | ||
| return result; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Src/PRuntimes/PExplicitRuntime/src/main/java/pexplicit/runtime/machine/PMachineId.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package pexplicit.runtime.machine; | ||
|
|
||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| @Getter | ||
| public class PMachineId { | ||
| Class<? extends PMachine> type; | ||
| int typeId; | ||
| @Setter | ||
| String name; | ||
|
|
||
| public PMachineId(Class<? extends PMachine> t, int tid) { | ||
| type = t; | ||
| typeId = tid; | ||
| name = null; | ||
| } | ||
|
|
||
|
|
||
| @Override | ||
| public String toString() { | ||
| return name; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| if (obj == this) | ||
| return true; | ||
| else if (!(obj instanceof PMachineId)) { | ||
| return false; | ||
| } | ||
| PMachineId rhs = (PMachineId) obj; | ||
| return this.type == rhs.type && this.typeId == rhs.typeId; | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would this be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we are allocating the machine the very first time here