Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AMOEBA3
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
SMAC
Learning Group
AMOEBA3
Commits
4749924b
Commit
4749924b
authored
7 years ago
by
BrunoDatoMeneses
Browse files
Options
Downloads
Patches
Plain Diff
ENH: space size tests on square experimentations
parent
89a7a468
No related branches found
No related tags found
1 merge request
!1
Merge Master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AMOEBA3/src/experiments/badContext/BadContextLauncherEasy.java
+11
-1
11 additions, 1 deletion
...A3/src/experiments/badContext/BadContextLauncherEasy.java
AMOEBA3/src/experiments/badContext/BadContextManager.java
+12
-4
12 additions, 4 deletions
AMOEBA3/src/experiments/badContext/BadContextManager.java
with
23 additions
and
5 deletions
AMOEBA3/src/experiments/badContext/BadContextLauncherEasy.java
+
11
−
1
View file @
4749924b
...
@@ -39,11 +39,21 @@ public class BadContextLauncherEasy implements Serializable {
...
@@ -39,11 +39,21 @@ public class BadContextLauncherEasy implements Serializable {
amoeba
.
setDataForErrorMargin
(
0.5
,
1
,
1
,
0.4
,
10
,
100
);
amoeba
.
setDataForErrorMargin
(
0.5
,
1
,
1
,
0.4
,
10
,
100
);
amoeba
.
setDataForInexactMargin
(
0.5
,
1
,
1
,
0.4
,
10
,
100
);
amoeba
.
setDataForInexactMargin
(
0.5
,
1
,
1
,
0.4
,
10
,
100
);
/* Default */
// amoeba.setAVT_acceleration(2);
// amoeba.setAVT_deceleration(1./3.);
// amoeba.setAVT_percentAtStart(0.2);
/* Custum */
amoeba
.
setAVT_acceleration
(
0.5
);
amoeba
.
setAVT_deceleration
(
0.5
);
amoeba
.
setAVT_percentAtStart
(
0.001
);
amoeba
.
setRememberState
(
false
);
amoeba
.
setRememberState
(
false
);
amoeba
.
setGenerateCSV
(
false
);
amoeba
.
setGenerateCSV
(
false
);
/* This is the initialization of the studied system. It's only for the sake of example, not a part of AMOEBA initialization*/
/* This is the initialization of the studied system. It's only for the sake of example, not a part of AMOEBA initialization*/
BadContextManager
bcm
=
new
BadContextManager
();
BadContextManager
bcm
=
new
BadContextManager
(
50.0
);
bcm
.
setWorld
(
amoeba
.
getScheduler
().
getWorld
());
bcm
.
setWorld
(
amoeba
.
getScheduler
().
getWorld
());
ArrayList
<
Percept
>
percepts
=
new
ArrayList
<
Percept
>();
ArrayList
<
Percept
>
percepts
=
new
ArrayList
<
Percept
>();
...
...
This diff is collapsed.
Click to expand it.
AMOEBA3/src/experiments/badContext/BadContextManager.java
+
12
−
4
View file @
4749924b
...
@@ -27,10 +27,18 @@ public class BadContextManager implements StudiedSystem, Serializable{
...
@@ -27,10 +27,18 @@ public class BadContextManager implements StudiedSystem, Serializable{
/** The first step. */
/** The first step. */
boolean
firstStep
=
true
;
boolean
firstStep
=
true
;
double
spaceSize
;
/** The world. */
/** The world. */
World
world
;
World
world
;
Random
generator
;
Random
generator
;
public
BadContextManager
(
double
size
)
{
this
.
spaceSize
=
size
;
}
/* (non-Javadoc)
/* (non-Javadoc)
* @see kernel.StudiedSystem#playOneStep(double)
* @see kernel.StudiedSystem#playOneStep(double)
*/
*/
...
@@ -41,8 +49,8 @@ public class BadContextManager implements StudiedSystem, Serializable{
...
@@ -41,8 +49,8 @@ public class BadContextManager implements StudiedSystem, Serializable{
if
(
generator
==
null
)
generator
=
new
Random
(
29
);
if
(
generator
==
null
)
generator
=
new
Random
(
29
);
x
=
(
generator
.
nextDouble
()
-
0.5
)
*
200
;
x
=
(
generator
.
nextDouble
()
-
0.5
)
*
spaceSize
*
4
;
y
=
(
generator
.
nextDouble
()-
0.5
)
*
200
;
y
=
(
generator
.
nextDouble
()-
0.5
)
*
spaceSize
*
4
;
}
}
/* (non-Javadoc)
/* (non-Javadoc)
...
@@ -51,9 +59,9 @@ public class BadContextManager implements StudiedSystem, Serializable{
...
@@ -51,9 +59,9 @@ public class BadContextManager implements StudiedSystem, Serializable{
@Override
@Override
public
HashMap
<
String
,
Double
>
getOutput
()
{
public
HashMap
<
String
,
Double
>
getOutput
()
{
HashMap
<
String
,
Double
>
out
=
new
HashMap
<
String
,
Double
>();
HashMap
<
String
,
Double
>
out
=
new
HashMap
<
String
,
Double
>();
double
size
=
55
;
result
=
(
y
>
-
size
&&
y
<
size
&&
x
<
size
&&
x
>
-
size
)
?
0.0
:
1.0
;
result
=
(
y
>
-
spaceSize
&&
y
<
spaceSize
&&
x
<
spaceSize
&&
x
>
-
spaceSize
)
?
0.0
:
1.0
;
// result = (x > 2*y) ? 0.0 : 1.0;
// result = (x > 2*y) ? 0.0 : 1.0;
out
.
put
(
"x"
,
x
);
out
.
put
(
"x"
,
x
);
...
...
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