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
ca71d0e3
Commit
ca71d0e3
authored
5 years ago
by
BrunoDatoMeneses
Browse files
Options
Downloads
Patches
Plain Diff
ADD: new minimal mains for amoeba
parent
3a7db9ca
Branches
Branches containing commit
No related tags found
1 merge request
!4
Exp rein
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AMOEBAonAMAK/src/experiments/MinimalMainCommandLineMode.java
+40
-0
40 additions, 0 deletions
AMOEBAonAMAK/src/experiments/MinimalMainCommandLineMode.java
AMOEBAonAMAK/src/experiments/MinimalMainUI.java
+40
-0
40 additions, 0 deletions
AMOEBAonAMAK/src/experiments/MinimalMainUI.java
with
80 additions
and
0 deletions
AMOEBAonAMAK/src/experiments/MinimalMainCommandLineMode.java
0 → 100644
+
40
−
0
View file @
ca71d0e3
package
experiments
;
import
fr.irit.smac.amak.Configuration
;
import
kernel.AMOEBA
;
import
kernel.StudiedSystem
;
/**
* The most minimal main possible producing a functioning amoeba.
* @author Hugo
*
*/
public
class
MinimalMainCommandLineMode
{
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
Configuration
.
commandLineMode
=
true
;
// create a system to be studied
StudiedSystem
studiedSystem
=
new
F_XY_System
(
50.0
);
// create the amoeba
// Make sure the path to the config file is correct.
AMOEBA
amoeba
=
new
AMOEBA
(
null
,
null
,
"resources/twoDimensionsLauncher.xml"
,
studiedSystem
);
// a window should have appeared, allowing you to control and visualize the amoeba.
// Learning and Request example
long
start
=
System
.
currentTimeMillis
();
for
(
int
i
=
0
;
i
<
1001
;
++
i
)
{
studiedSystem
.
playOneStep
();
amoeba
.
learn
(
studiedSystem
.
getOutput
());
}
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"Done in : "
+
(
end
-
start
)
+
" ms"
);
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
studiedSystem
.
playOneStep
();
System
.
out
.
println
(
amoeba
.
request
(
studiedSystem
.
getOutput
()));
}
}
}
This diff is collapsed.
Click to expand it.
AMOEBAonAMAK/src/experiments/MinimalMain.java
→
AMOEBAonAMAK/src/experiments/MinimalMain
UI
.java
+
40
−
0
View file @
ca71d0e3
package
experiments
;
import
fr.irit.smac.amak.Configuration
;
import
kernel.AMOEBA
;
import
kernel.StudiedSystem
;
...
...
@@ -8,15 +9,32 @@ import kernel.StudiedSystem;
* @author Hugo
*
*/
public
class
MinimalMain
{
public
class
MinimalMain
UI
{
//TODO
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
Configuration
.
commandLineMode
=
false
;
// create a system to be studied
StudiedSystem
studiedSystem
=
new
F_XY_System
(
50.0
);
// create the amoeba
// Make sure the path to the config file is correct.
AMOEBA
amoeba
=
new
AMOEBA
(
"resources/twoDimensionsLauncher.xml"
,
studiedSystem
);
AMOEBA
amoeba
=
new
AMOEBA
(
null
,
null
,
"resources/twoDimensionsLauncher.xml"
,
studiedSystem
);
// a window should have appeared, allowing you to control and visualize the amoeba.
// Learning and Request example
long
start
=
System
.
currentTimeMillis
();
for
(
int
i
=
0
;
i
<
1001
;
++
i
)
{
studiedSystem
.
playOneStep
();
amoeba
.
learn
(
studiedSystem
.
getOutput
());
}
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"Done in : "
+
(
end
-
start
)
+
" ms"
);
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
studiedSystem
.
playOneStep
();
System
.
out
.
println
(
amoeba
.
request
(
studiedSystem
.
getOutput
()));
}
}
}
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