Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CMIS-IADS
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reeves, David E
CMIS-IADS
Commits
5ae67298
Commit
5ae67298
authored
4 years ago
by
Reeves, David E
Browse files
Options
Downloads
Patches
Plain Diff
* added ability to talk to the borg in libraries
parent
23003f25
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/HTN/Trees/Red/RandomMove.xml
+7
-4
7 additions, 4 deletions
scripts/HTN/Trees/Red/RandomMove.xml
scripts/HTNBehaviors.py
+35
-0
35 additions, 0 deletions
scripts/HTNBehaviors.py
scripts/data/road_edges.srz
+0
-0
0 additions, 0 deletions
scripts/data/road_edges.srz
with
42 additions
and
4 deletions
scripts/HTN/Trees/Red/RandomMove.xml
+
7
−
4
View file @
5ae67298
...
@@ -13,15 +13,18 @@
...
@@ -13,15 +13,18 @@
<HTNNode
AllowMsg=
"true"
Name=
"moveToData"
Type=
"DEFAULT"
>
<HTNNode
AllowMsg=
"true"
Name=
"moveToData"
Type=
"DEFAULT"
>
<Parent>
initInfo
</Parent>
<Parent>
initInfo
</Parent>
<Code
IsFile=
"false"
>
from HTNBehaviors import SendEntityEventDelay
<Code
IsFile=
"false"
>
from HTNBehaviors import SendEntityEventDelay
from HTNBehaviors import GetRandomPoint
import cxxi.model.behavior.PythonUtilities as PythonUtilities
import cxxi.model.behavior.PythonUtilities as PythonUtilities
import math
import math
int_num = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
#
int_num = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
int_num *= borg.allWPs.size()
#
int_num *= borg.allWPs.size()
int_num = int(round(int_num))
#
int_num = int(round(int_num))
#destName = "INTERSECTION" + str(int_num)
#destName = "INTERSECTION" + str(int_num)
destName = borg.allWPs.get(int_num).getName()
#destName = borg.allWPs.get(int_num).getName()
destName = GetRandomPoint()
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveToDestination", ["RANDOM", destName], 5.0)
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveToDestination", ["RANDOM", destName], 5.0)
borg.delay=1.0
borg.delay=1.0
...
...
This diff is collapsed.
Click to expand it.
scripts/HTNBehaviors.py
+
35
−
0
View file @
5ae67298
...
@@ -3,10 +3,45 @@ from java.util import ArrayList
...
@@ -3,10 +3,45 @@ from java.util import ArrayList
import
cxxi.model.objects.holders.CMHolder
as
CMHolder
import
cxxi.model.objects.holders.CMHolder
as
CMHolder
import
cxxi.model.behavior.OrderUtilities
as
OrderUtilities
import
cxxi.model.behavior.OrderUtilities
as
OrderUtilities
import
mtry.cxxi.model.HierarchicalTaskNetwork.GoalContainer
as
GoalContainer
import
cxxi.model.behavior.PythonUtilities
as
PythonUtilities
#from UtilityFuncsExp import HTNBorg as borg
__HTN_PATH__
=
"
HTN/Trees/
"
__HTN_PATH__
=
"
HTN/Trees/
"
__BASIC_MOVE_PATH__
=
"
HTN/Trees/BasicMove.xml
"
__BASIC_MOVE_PATH__
=
"
HTN/Trees/BasicMove.xml
"
__NETWORK_MOVE_PATH__
=
"
HTN/Trees/NetworkMove.xml
"
__NETWORK_MOVE_PATH__
=
"
HTN/Trees/NetworkMove.xml
"
borg
=
None
# Reads from a list of allWPs
def
GetRandomPoint
():
_InitBorgInternal
()
int_num
=
PythonUtilities
.
_py_getRandomNumber
(
"
UNIFORM
"
,
[
0.0
,
1.0
])
int_num
*=
borg
.
allWPs
.
size
()
int_num
=
int
(
round
(
int_num
))
destName
=
borg
.
allWPs
.
get
(
int_num
).
getName
()
return
destName
def
_InitBorgInternal
():
global
borg
if
borg
==
None
:
borgName
=
GoalContainer
.
getBorgName
()
impStr
=
"
from
"
+
borgName
+
"
import HTNBorg
"
exec
(
impStr
)
borg
=
HTNBorg
()
print
"
Borg created
"
else
:
print
"
Borg already created
"
def
TestBorg
():
_InitBorgInternal
()
print
"
Test borg=
"
,
borg
.
allWPs
.
size
()
def
ConvertToJavaList
(
l
):
def
ConvertToJavaList
(
l
):
al
=
ArrayList
()
al
=
ArrayList
()
for
o
in
l
:
for
o
in
l
:
...
...
This diff is collapsed.
Click to expand it.
scripts/data/road_edges.srz
+
0
−
0
View file @
5ae67298
No preview for this file type
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