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
3940d3a6
Commit
3940d3a6
authored
4 years ago
by
BrunoDatoMeneses
Browse files
Options
Downloads
Patches
Plain Diff
CLN: clean comments
parent
a25110eb
Branches
devWithoutCleaning
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ELLSAonAMAK/src/agents/context/Context.java
+1
-85
1 addition, 85 deletions
ELLSAonAMAK/src/agents/context/Context.java
with
1 addition
and
85 deletions
ELLSAonAMAK/src/agents/context/Context.java
+
1
−
85
View file @
3940d3a6
...
@@ -323,39 +323,7 @@ public class Context extends EllsaAgent {
...
@@ -323,39 +323,7 @@ public class Context extends EllsaAgent {
}
}
// private void buildContext(Context fatherContext, HashMap<Percept, Pair<Double, Double>> contextDimensions) {
//
// buildContextCommon();
//
// ArrayList<Percept> var = getAmas().getPercepts();
// for (Percept pct : var) {
// Range r;
// double center = contextDimensions.get(pct).getA();
// double length = contextDimensions.get(pct).getB();
// r = new Range(this, center - length / 2, center + length / 2, 0, true, true, pct);
//
// ranges.put(pct, r);
// ranges.get(pct).setValue(center);
//
// pct.addContextProjection(this);
// }
//
// // expand();
//
// this.confidence = fatherContext.confidence;
//
// this.localModel = getAmas().buildLocalModel(this);
// // this.formulaLocalModel = ((LocalModelMillerRegression)
// // bestNearestContext.localModel).getFormula(bestNearestContext);
// Double[] coef = fatherContext.localModel.getCoef();
// this.localModel.setCoef(coef);
// this.actionProposition = fatherContext.localModel.getProposition();
//
// getAmas().addAlteredContext(this);
// this.setName(String.valueOf(this.hashCode()));
//
// // world.trace(new ArrayList<String>(Arrays.asList(this.getName(), "EXPS")));
// }
private
void
buildContextWithoutOracle
(
double
endogenousPredicion
)
{
private
void
buildContextWithoutOracle
(
double
endogenousPredicion
)
{
...
@@ -516,23 +484,7 @@ public class Context extends EllsaAgent {
...
@@ -516,23 +484,7 @@ public class Context extends EllsaAgent {
}
}
/*public ArrayList<Context> getContextsOnAPerceptDirectionFromContextsNeighbors(ArrayList<Context> contextNeighbors,
Percept pctDirection) {
ArrayList<Context> contexts = new ArrayList<Context>();
boolean test = true;
for (Context ctxtNeigbor : contextNeighbors) {
for (Percept pct : ranges.keySet()) {
if (pct != pctDirection) {
test = test && (this.ranges.get(pct).distance(ctxtNeigbor.getRanges().get(pct)) < 0);
}
}
if (test) {
contexts.add(ctxtNeigbor);
}
}
return contexts;
}*/
public
ArrayList
<
Context
>
getContextsOnAPerceptDirectionFromContextsNeighbors
(
ArrayList
<
Context
>
contextNeighbors
,
public
ArrayList
<
Context
>
getContextsOnAPerceptDirectionFromContextsNeighbors
(
ArrayList
<
Context
>
contextNeighbors
,
Percept
pctDirection
,
SpatialContext
expandingContext
)
{
Percept
pctDirection
,
SpatialContext
expandingContext
)
{
...
@@ -555,43 +507,7 @@ public class Context extends EllsaAgent {
...
@@ -555,43 +507,7 @@ public class Context extends EllsaAgent {
return
contexts
;
return
contexts
;
}
}
/*public void expand() {
ArrayList<Context> neighborsOnOneDirection;
HashMap<Percept, SpatialContext> alternativeContexts = new HashMap<Percept, SpatialContext>();
double maxVolume = this.getVolume();
double currentVolume;
SpatialContext maxVolumeSpatialContext = null;
for (Percept fixedPct : ranges.keySet()) {
alternativeContexts.put(fixedPct, new SpatialContext(this));
for (Percept pctDirectionForExpanding : ranges.keySet()) {
if (pctDirectionForExpanding != fixedPct) {
neighborsOnOneDirection = getContextsOnAPerceptDirectionFromContextsNeighbors(
getAmas().getHeadAgent().getActivatedNeighborsContexts(), pctDirectionForExpanding,
alternativeContexts.get(fixedPct));
Pair<Double, Double> expandingRadiuses = getMaxExpansionsForContextExpansionAfterCreation(
neighborsOnOneDirection, pctDirectionForExpanding);
alternativeContexts.get(fixedPct).expandEnd(pctDirectionForExpanding, expandingRadiuses.getB());
alternativeContexts.get(fixedPct).expandStart(pctDirectionForExpanding, expandingRadiuses.getA());
}
}
currentVolume = alternativeContexts.get(fixedPct).getVolume();
if (currentVolume > maxVolume) {
maxVolume = currentVolume;
maxVolumeSpatialContext = alternativeContexts.get(fixedPct);
}
}
if (maxVolumeSpatialContext != null) {
matchSpatialContextRanges(maxVolumeSpatialContext);
}
}*/
public
void
matchSpatialContextRanges
(
SpatialContext
biggerContextForCreation
)
{
public
void
matchSpatialContextRanges
(
SpatialContext
biggerContextForCreation
)
{
for
(
Percept
pct
:
ranges
.
keySet
())
{
for
(
Percept
pct
:
ranges
.
keySet
())
{
...
...
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