Commit 444d9788 authored by Jonathan Shahen's avatar Jonathan Shahen

Fixed formating bug in ASAPTime NSA (there was a t in the query that shouldn't be there)

Added debugging messages
parent 0c828d26
......@@ -249,6 +249,7 @@ roleArray returns [ArrayList<Role> r] @init {
{$r.add($b.role);}
)* RightBracket
| a = myrole {$r.add($a.role);}
;
timeslotArray returns [ArrayList<TimeSlot> t] @init {
......
<! Conversion to ASAPTime NSA Input Format !>
<! !>
CONFIG <numRoles> <numTimeslots>
GOAL <goalRole> t<goalTimeslot>
GOAL <goalRole> <goalTimeslot>
<! !>
<! can_revoke 3 , t3 , true ; t5 , 14 !>
<rules_nsa:{r|<r.ruleType> <if(r.adminRole)><r.adminRole><else>true<endif> , t<r.adminTime> , <if(r.precondition)><r.precondition; separator=" & "><else>true<endif> ; t<r.roleTime> , <r.role><\n>}>
\ No newline at end of file
......@@ -24,7 +24,7 @@ import mohawk.global.pieces.reduced.rules.ASAPTimeNSA_Rule;
import org.stringtemplate.v4.ST;
public class ConvertToASAPTimeNSA extends ConvertTo {
public static final Logger logger = Logger.getLogger("mohawk-converter");
public static final Logger logger = Logger.getGlobal();
@Override
public String convert(MohawkT m, File file, Boolean writeToFile) {
......@@ -49,6 +49,9 @@ public class ConvertToASAPTimeNSA extends ConvertTo {
rules.addAll(toASAPTimeNSA_Rules(r, m.roleHelper, m.timeIntervalHelper));
}
logger.fine("Rules: " + m.getAllRules());
logger.fine("Reduced Rules: " + rules);
st.add("numRoles", m.roleHelper.size());
st.add("numTimeslots", m.timeIntervalHelper.sizeReduced());
st.add("goalRole", query.goalRole);
......@@ -144,8 +147,12 @@ public class ConvertToASAPTimeNSA extends ConvertTo {
precondition.add(roleHelper.indexOf(r));
}
ASAPTimeNSA_Rule rule_t;
logger.fine("Timeslots: " + timeIntervalHelper._timeIntervals);
logger.fine("Reduced Timeslots: " + timeIntervalHelper._reducedTimeIntervals);
logger.fine("Admin Interval: " + adminInterval);
logger.fine("Role Schedule: " + roleSchedule);
ASAPTimeNSA_Rule rule_t;
for (Integer adminTimeslot : adminInterval) {
for (Integer roleTimeslot : roleSchedule) {
rule_t = new ASAPTimeNSA_Rule();
......@@ -161,6 +168,8 @@ public class ConvertToASAPTimeNSA extends ConvertTo {
rule_t.precondition = precondition;
rule_t.roleTime = roleTimeslot;
logger.fine("Adding rule to rules");
rules.add(rule_t);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment