Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
mohawk-t-conversion-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jon Shahen
mohawk-t-conversion-tool
Commits
32919cea
Commit
32919cea
authored
Jun 17, 2016
by
Jonathan Shahen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduction comments added
parent
3f060e2b
Pipeline
#12995
skipped
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
src/mohawk/converter/to/asaptime/ConvertToASAPTimeNSA.java
src/mohawk/converter/to/asaptime/ConvertToASAPTimeNSA.java
+2
-0
src/mohawk/converter/to/asaptime/ConvertToASAPTimeSA.java
src/mohawk/converter/to/asaptime/ConvertToASAPTimeSA.java
+4
-0
src/mohawk/converter/to/mohawk/ConvertToMohawk.java
src/mohawk/converter/to/mohawk/ConvertToMohawk.java
+7
-4
src/mohawk/converter/to/tred/ConvertToTRole.java
src/mohawk/converter/to/tred/ConvertToTRole.java
+3
-0
No files found.
src/mohawk/converter/to/asaptime/ConvertToASAPTimeNSA.java
View file @
32919cea
...
...
@@ -41,10 +41,12 @@ public class ConvertToASAPTimeNSA extends ConvertTo {
roleHelper
.
setupSortedRoles
();
// Reduce TimeIntervals to Timeslots
timeIntervalHelper
.
allowZeroTimeslot
=
false
;
// time-slots start from t1 NOT t0!
// Reduction (2)
timeIntervalHelper
.
reduceToTimeslots
();
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_"
+
"sortRolesReduceTimeslots"
);
// Convert Query to Reduced ASAPTime NSA Query and add any extra rules as needed
// Reduction (1)
ASAPTimeNSA_Query
query
=
toASAPTimeNSA_Query
(
workableQuery
,
rules
,
roleHelper
,
timeIntervalHelper
);
// Convert Rules into Reduced ASAPTime NSA Rules
...
...
src/mohawk/converter/to/asaptime/ConvertToASAPTimeSA.java
View file @
32919cea
...
...
@@ -40,6 +40,7 @@ public class ConvertToASAPTimeSA extends ConvertTo {
// removeEnableDisableRules and alwaysOnRules are Deep Copies
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_removeEnableDisableRules"
);
// Reduction (3)
switch
(
canEnableVersion
)
{
case
1
:
workableRules
=
roleHelper
.
removeEnableDisableRules
(
m
.
getAllRules
());
...
...
@@ -57,10 +58,12 @@ public class ConvertToASAPTimeSA extends ConvertTo {
}
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_"
+
"alwaysOnRules"
);
// Reduction (4)
workableRules
=
roleHelper
.
alwaysOnRules
(
workableRules
,
workableQuery
,
timeIntervalHelper
);
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_"
+
"alwaysOnRules"
);
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_"
+
"reduceToTimeslots"
);
// Reduction (2)
timeIntervalHelper
.
allowZeroTimeslot
=
false
;
// time-slots start from t1 NOT t0!
timeIntervalHelper
.
reduceToTimeslots
();
// Reduce TimeIntervals to Timeslots
...
...
@@ -75,6 +78,7 @@ public class ConvertToASAPTimeSA extends ConvertTo {
}
// Convert Query to Reduced ASAPTime SA Query and add any extra rules as needed
// Reduction (1)
ASAPTimeSA_Query
query
=
toASAPTimeSA_Query
(
workableQuery
,
workableRules
,
roleHelper
,
timeIntervalHelper
);
// Convert Rules into Reduced ASAPTime SA Rules
...
...
src/mohawk/converter/to/mohawk/ConvertToMohawk.java
View file @
32919cea
...
...
@@ -44,6 +44,7 @@ public class ConvertToMohawk extends ConvertTo {
try
{
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_removeEnableDisableRules"
);
// Reduction (3)
switch
(
canEnableVersion
)
{
case
1
:
workableRules
=
roleHelper
.
removeEnableDisableRules
(
m
.
getAllRules
());
...
...
@@ -53,23 +54,23 @@ public class ConvertToMohawk extends ConvertTo {
workableRules
=
roleHelper
.
removeEnableDisableRulesv2
(
m
.
getAllRules
());
break
;
}
// (3)
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_removeEnableDisableRules"
);
// Convert Query to Reduced ASAPTime SA Query and add any extra rules as needed
// Mohawk_Query query = toMohawk_Query(workableQuery, workableRules, roleHelper, timeIntervalHelper);
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_alwaysOnRules"
);
// Reduction (4)
workableRules
=
roleHelper
.
alwaysOnRules
(
workableRules
,
workableQuery
,
timeIntervalHelper
);
// (4)
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_alwaysOnRules"
);
// Convert Query to Reduced ASAPTime SA Query and add any extra rules as needed
// Reduction (1)
Mohawk_Query
query
=
toMohawk_Query
(
workableQuery
,
workableRules
,
roleHelper
,
timeIntervalHelper
);
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_removeUninvokablePrecondtions"
);
// Optimization
workableRules
=
roleHelper
.
removeUninvokablePrecondtions
(
workableRules
,
false
);
// (6)
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_removeUninvokablePrecondtions"
);
if
(
logger
.
isLoggable
(
Level
.
FINE
))
{
...
...
@@ -78,8 +79,8 @@ public class ConvertToMohawk extends ConvertTo {
}
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_removePrecondtionsCanRevoke"
);
// Reduction (6)
workableRules
=
roleHelper
.
removePrecondtionsCanRevoke
(
workableRules
,
false
);
// (6)
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_removePrecondtionsCanRevoke"
);
if
(
logger
.
isLoggable
(
Level
.
FINE
))
{
...
...
@@ -88,6 +89,7 @@ public class ConvertToMohawk extends ConvertTo {
}
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_removeTemporality"
);
// Reduction (5)
roleHelperTemporality
=
new
RoleHelper
(
roleHelper
);
ArrayList
<
Object
>
reducedRules
=
roleHelperTemporality
.
removeTemporality
(
workableRules
,
timeIntervalHelper
);
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_removeTemporality"
);
...
...
@@ -120,6 +122,7 @@ public class ConvertToMohawk extends ConvertTo {
}
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_convertRules"
);
// Reduction (1)
boolean
queryFound
=
query
.
finalize
(
roleHelperTemporality
,
shortRolenames
);
if
(
queryFound
==
false
)
{
throw
new
Exception
(
"The query could not find the Goal Role!"
);
}
// Stats and logging
...
...
src/mohawk/converter/to/tred/ConvertToTRole.java
View file @
32919cea
...
...
@@ -42,6 +42,7 @@ public class ConvertToTRole extends ConvertTo {
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_"
+
"deepcopy"
);
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_removeEnableDisableRules"
);
// Reduction (3)
switch
(
canEnableVersion
)
{
case
1
:
workableRules
=
roleHelper
.
removeEnableDisableRules
(
m
.
getAllRules
());
...
...
@@ -54,6 +55,7 @@ public class ConvertToTRole extends ConvertTo {
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_removeEnableDisableRules"
);
/* Timing */
timing
.
startTimer
(
tPrefix
+
"_"
+
"alwaysOnRules"
);
// Reduction (4)
workableRules
=
roleHelper
.
alwaysOnRules
(
workableRules
,
workableQuery
,
timeIntervalHelper
);
/* Timing */
timing
.
stopTimer
(
tPrefix
+
"_"
+
"alwaysOnRules"
);
...
...
@@ -65,6 +67,7 @@ public class ConvertToTRole extends ConvertTo {
TRole_Query
query
=
toTRole_Query
(
workableQuery
,
workableRules
,
roleHelper
,
timeIntervalHelper
);
// Finalize the Query
// Reduction (1)
query
.
finalize
(
roleHelper
);
// Stats and logging
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment