Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ttc18live
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stgroup
ttc18live
Commits
5e0dcbce
Commit
5e0dcbce
authored
6 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Add debug flag.
parent
e09b589c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
solve/src/main/jastadd/queries.jrag
+9
-1
9 additions, 1 deletion
solve/src/main/jastadd/queries.jrag
solve/src/main/java/de/tudresden/inf/st/ttc18live/AbstractLiveContestDriver.java
+12
-3
12 additions, 3 deletions
...tudresden/inf/st/ttc18live/AbstractLiveContestDriver.java
with
21 additions
and
4 deletions
solve/src/main/jastadd/queries.jrag
+
9
−
1
View file @
5e0dcbce
aspect Queries {
public boolean SocialNetwork.debug = false;
syn int ModelElement.score() = 0;
syn java.util.Set<User> User.getCommentLikerFriends(Comment comment) circular [new java.util.HashSet<User>()];
...
...
@@ -71,7 +73,13 @@ aspect Queries {
}
}
}
return elements[0].getId() + "|" + elements[1].getId() + "|" + elements[2].getId();
if (debug) {
return elements[0].getId() + "--" + elements[0].score() +
"|" + elements[1].getId() + "--" + elements[1].score() +
"|" + elements[2].getId() + "--" + elements[2].score();
} else {
return elements[0].getId() + "|" + elements[1].getId() + "|" + elements[2].getId();
}
}
syn boolean Submission.hasBetterScoreThan(Submission other) {
...
...
This diff is collapsed.
Click to expand it.
solve/src/main/java/de/tudresden/inf/st/ttc18live/AbstractLiveContestDriver.java
+
12
−
3
View file @
5e0dcbce
...
...
@@ -7,6 +7,9 @@ import org.apache.logging.log4j.core.LoggerContext;
import
org.apache.logging.log4j.core.config.Configuration
;
import
java.nio.file.Path
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* Abstract Driver for a JastAdd solution.
...
...
@@ -15,6 +18,7 @@ import java.nio.file.Path;
*/
public
abstract
class
AbstractLiveContestDriver
{
private
Boolean
Debug
;
private
String
ChangePath
;
private
String
RunIndex
;
private
int
Sequences
;
...
...
@@ -31,6 +35,7 @@ public abstract class AbstractLiveContestDriver {
AbstractLiveContestDriver
()
{
ChangeSet
=
System
.
getenv
(
"ChangeSet"
);
ChangePath
=
System
.
getenv
(
"ChangePath"
);
Debug
=
Boolean
.
valueOf
(
System
.
getenv
(
"Debug"
));
Query
=
System
.
getenv
(
"Query"
).
toUpperCase
();
}
...
...
@@ -112,6 +117,7 @@ public abstract class AbstractLiveContestDriver {
stopwatch
=
System
.
nanoTime
();
SocialNetwork
socialNetwork
=
LoadImpl
();
socialNetwork
.
debug
=
Debug
;
if
(
traceEvents
)
{
socialNetwork
.
enableTracing
();
}
...
...
@@ -161,16 +167,19 @@ public abstract class AbstractLiveContestDriver {
}
else
{
iterationStr
=
Integer
.
toString
(
iteration
);
}
System
.
out
.
println
(
String
.
format
(
"%s;%s;%s;%s;%s;%s;Time;%s"
,
Tool
,
Query
,
ChangeSet
,
RunIndex
,
iterationStr
,
phase
.
toString
(),
Long
.
toString
(
stopwatch
)));
System
.
out
.
println
(
String
.
format
(
"%s;%s;%s;%s;%s;%s;Time;%s"
,
Tool
,
Query
,
ChangeSet
,
RunIndex
,
iterationStr
,
phase
.
toString
(),
Long
.
toString
(
stopwatch
)));
Runtime
.
getRuntime
().
gc
();
Runtime
.
getRuntime
().
gc
();
Runtime
.
getRuntime
().
gc
();
Runtime
.
getRuntime
().
gc
();
Runtime
.
getRuntime
().
gc
();
long
memoryUsed
=
Runtime
.
getRuntime
().
totalMemory
()
-
Runtime
.
getRuntime
().
freeMemory
();
System
.
out
.
println
(
String
.
format
(
"%s;%s;%s;%s;%s;%s;Memory;%s"
,
Tool
,
Query
,
ChangeSet
,
RunIndex
,
iterationStr
,
phase
.
toString
(),
Long
.
toString
(
memoryUsed
)));
System
.
out
.
println
(
String
.
format
(
"%s;%s;%s;%s;%s;%s;Memory;%s"
,
Tool
,
Query
,
ChangeSet
,
RunIndex
,
iterationStr
,
phase
.
toString
(),
Long
.
toString
(
memoryUsed
)));
if
(
result
!=
null
)
{
System
.
out
.
println
(
String
.
format
(
"%s;%s;%s;%s;%s;%s;Elements;%s"
,
Tool
,
Query
,
ChangeSet
,
RunIndex
,
iterationStr
,
phase
.
toString
(),
result
));
System
.
out
.
println
(
String
.
format
(
"%s;%s;%s;%s;%s;%s;Elements;%s"
,
Tool
,
Query
,
ChangeSet
,
RunIndex
,
iterationStr
,
phase
.
toString
(),
result
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment