Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Prasetya, S.W.B. (Wishnu)
t3
Commits
e957762f
Commit
e957762f
authored
Jan 05, 2018
by
ISWB Prasetya
Browse files
small tweak for the evo-like engine of the G2 generator.
parent
617fd057
Changes
5
Hide whitespace changes
Inline
Side-by-side
build.xml
View file @
e957762f
...
...
@@ -72,6 +72,15 @@
<zip
basedir=
"${dist}"
destfile=
"${build}/${VERSION}_dist.zip"
/>
</target>
<!-- for jarring T3 and support tools for SBST unit testing tool competition -->
<target
name=
"jarT3SBST"
depends=
"jar"
description=
"Jarring all T3 classes."
>
<jar
destfile=
"${build}/T3G2_SBST2016.jar"
>
<zipfileset
src=
"${build}/${RELEASEname}.jar"
includes=
"**/*.class"
/>
<zipfileset
src=
"${build}/../t3static/T3static_v0.jar"
includes=
"**/*.class"
/>
<zipfileset
src=
"${build}/../t3tools/CPscanner.jar"
includes=
"**/*.class"
/>
</jar>
</target>
<target
name=
"clean"
description=
"Cleaning."
>
<echo>
Cleaning...
</echo>
<delete
dir=
"${build}"
/>
...
...
src/Sequenic/T3/DerivativeSuiteGens/Gen2/EvoSingleTarget.java
View file @
e957762f
...
...
@@ -55,8 +55,8 @@ public class EvoSingleTarget extends SingleTarget{
}
protected
SUITE
generateFreshSuite
()
{
if
(
numberOfIterations
()>=
3
&&
getImprovement
(
2
)
<=
0.0
)
{
// we get too little improvementin the last
two
rounds, flip the mode
if
(
numberOfIterations
()>=
10
&&
getImprovement
(
4
)
<=
0.0
)
{
// we get too little improvementin the last
n
rounds, flip the mode
flipMode
()
;
// if the mode is switch back to random, throw away the evolved population
if
(
isInRandomMode
())
evolvedPopulation
=
null
;
...
...
src/Sequenic/T3/DerivativeSuiteGens/Gen2/StaticInfo.java
View file @
e957762f
...
...
@@ -142,7 +142,20 @@ public class StaticInfo {
private
void
registerConstants
(
Pair
<
String
,
List
<
String
>>
constants
,
String
type
)
{
//System.out.println(">> " + constants.snd);
for
(
String
c
:
constants
.
snd
)
registerConstant
(
constants
.
fst
,
c
,
type
)
;
for
(
String
c
:
constants
.
snd
)
{
registerConstant
(
constants
.
fst
,
c
,
type
)
;
// for integer constant, also register c-1 and c+1 border values:
if
(
type
==
"numeric"
)
{
try
{
int
i
=
Integer
.
parseInt
(
c
.
substring
(
1
,
c
.
length
()-
1
))
;
int
iplus
=
i
+
1
;
int
imin
=
i
-
1
;
registerConstant
(
constants
.
fst
,
"<"
+
iplus
+
">"
,
type
)
;
registerConstant
(
constants
.
fst
,
"<"
+
imin
+
">"
,
type
)
;
}
catch
(
Exception
e
)
{
}
}
}
}
private
void
registerConstant
(
String
mname
,
String
constant
,
String
type
)
{
...
...
t3supportTools/build.xml
View file @
e957762f
...
...
@@ -74,6 +74,17 @@
<target
name=
"compileAll"
description=
"Compiling all tools..."
depends=
"compileT3daikon,compileCPscanner,compileStandingen,compileT3configure"
>
</target>
<!-- for jarring CPscanner only (along with all its dependencies). Run clean first! -->
<target
name=
"CPscannerJar"
description=
"Jarring CPscanner..."
depends=
"compileCPscanner"
>
<echo>
Jarring all T3 support tools classes...
</echo>
<jar
basedir=
"${build}/classes"
destfile=
"${build}/CPscanner.jar"
>
<zipfileset
src=
"./cpscanner/libs/guava-14.0.1.jar"
includes=
"**/*.class"
/>
<zipfileset
src=
"./cpscanner/libs/reflections-0.9.9-RC1-uberjar.jar"
includes=
"**/*.class"
/>
<zipfileset
src=
"./cpscanner/libs/javassist.jar"
includes=
"**/*.class"
/>
</jar>
</target>
<!-- for jarring T3daikon only. Run clean first! -->
<target
name=
"T3daikonJar"
description=
"Jarring T3daikon ..."
depends=
"compileT3daikon"
>
<echo>
Jarring the T3daikon tool...
</echo>
...
...
@@ -81,7 +92,7 @@
<zipfileset
src=
"./daikon/libs/daikon.jar"
includes=
"**/*.class,**/*.properties"
/>
</jar>
</target>
<!-- this will jar all those support tools, and also add T3-static into the jar.
Also jar along all 3rd party dependency.
Does not include T3 itself.
...
...
xexamples/SomeExamples/IncomeTax.java
View file @
e957762f
...
...
@@ -14,14 +14,15 @@ public class IncomeTax {
public
IncomeTax
(
int
salary
,
String
location
)
{
if
(!
(
location
.
equals
(
"INSIDE"
)
||
location
.
equals
(
"OUTSIDE"
)))
throw
new
IllegalArgumentException
()
;
//
if (! (location.equals("INSIDE") || location.equals("OUTSIDE"))) throw new IllegalArgumentException() ;
if
(
salary
<
0
)
throw
new
IllegalArgumentException
()
;
this
.
salary
=
salary
;
//System.out.println(">> IncomeTax(" + salary + "," + location + ")") ;
this
.
salary
=
salary
;
this
.
location
=
location
;
}
public
int
getTax
()
{
//System.out.println(">>getTax
"
) ;
//System.out.println(">>getTax
on salary " + salary
) ;
if
(
location
.
equals
(
"OUTSIDE"
))
return
0
;
double
salary_
=
(
double
)
salary
;
double
tax
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment