Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openmole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RoiArthurB
openmole
Commits
c7f87ec1
Commit
c7f87ec1
authored
Apr 08, 2020
by
Romain Reuillon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Plugin] enh: add go parameter to netlogo task
parent
aa3efa86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
23 deletions
+42
-23
openmole/plugins/org.openmole.plugin.task.netlogo/src/main/scala/org/openmole/plugin/task/netlogo/NetLogoTask.scala
.../scala/org/openmole/plugin/task/netlogo/NetLogoTask.scala
+6
-3
openmole/plugins/org.openmole.plugin.task.netlogo5/src/main/scala/org/openmole/plugin/task/netlogo5/NetLogo5Task.scala
...cala/org/openmole/plugin/task/netlogo5/NetLogo5Task.scala
+18
-10
openmole/plugins/org.openmole.plugin.task.netlogo6/src/main/scala/org/openmole/plugin/task/netlogo6/NetLogo6Task.scala
...cala/org/openmole/plugin/task/netlogo6/NetLogo6Task.scala
+18
-10
No files found.
openmole/plugins/org.openmole.plugin.task.netlogo/src/main/scala/org/openmole/plugin/task/netlogo/NetLogoTask.scala
View file @
c7f87ec1
...
@@ -300,7 +300,8 @@ trait NetLogoTask extends Task with ValidateTask {
...
@@ -300,7 +300,8 @@ trait NetLogoTask extends Task with ValidateTask {
* Commands to run
* Commands to run
* @return
* @return
*/
*/
def
launchingCommands
:
Seq
[
FromContext
[
String
]]
def
go
:
Seq
[
FromContext
[
String
]]
def
setup
:
Seq
[
FromContext
[
String
]]
/**
/**
* Mapping of prototypes
* Mapping of prototypes
...
@@ -320,7 +321,7 @@ trait NetLogoTask extends Task with ValidateTask {
...
@@ -320,7 +321,7 @@ trait NetLogoTask extends Task with ValidateTask {
override
def
validate
=
Validate
{
p
⇒
override
def
validate
=
Validate
{
p
⇒
import
p._
import
p._
val
allInputs
=
External
.
PWD
::
inputs
.
toList
val
allInputs
=
External
.
PWD
::
inputs
.
toList
launchingCommands
.
flatMap
(
_
.
validate
(
allInputs
))
++
go
.
flatMap
(
_
.
validate
(
allInputs
))
++
External
.
validate
(
external
)(
allInputs
).
apply
++
External
.
validate
(
external
)(
allInputs
).
apply
++
NetLogoTask
.
validateNetLogoInputTypes
(
mapped
.
inputs
.
map
(
_
.
v
))
NetLogoTask
.
validateNetLogoInputTypes
(
mapped
.
inputs
.
map
(
_
.
v
))
}
}
...
@@ -338,6 +339,8 @@ trait NetLogoTask extends Task with ValidateTask {
...
@@ -338,6 +339,8 @@ trait NetLogoTask extends Task with ValidateTask {
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
"clear-all"
)
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
"clear-all"
)
for
(
cmd
←
setup
.
map
(
_
.
from
(
context
)))
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
cmd
,
ignoreError
)
seed
.
foreach
{
s
⇒
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
s
"random-seed ${context(s)}"
)
}
seed
.
foreach
{
s
⇒
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
s
"random-seed ${context(s)}"
)
}
for
(
inBinding
←
mapped
.
inputs
)
{
for
(
inBinding
←
mapped
.
inputs
)
{
...
@@ -345,7 +348,7 @@ trait NetLogoTask extends Task with ValidateTask {
...
@@ -345,7 +348,7 @@ trait NetLogoTask extends Task with ValidateTask {
NetLogoTask
.
setGlobal
(
instance
.
netLogo
,
inBinding
.
name
,
v
)
NetLogoTask
.
setGlobal
(
instance
.
netLogo
,
inBinding
.
name
,
v
)
}
}
for
(
cmd
←
launchingCommands
.
map
(
_
.
from
(
context
)))
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
cmd
,
ignoreError
)
for
(
cmd
←
go
.
map
(
_
.
from
(
context
)))
NetLogoTask
.
executeNetLogo
(
instance
.
netLogo
,
cmd
,
ignoreError
)
val
contextResult
=
val
contextResult
=
External
.
fetchOutputFiles
(
external
,
outputs
,
preparedContext
,
resolver
,
Seq
(
instance
.
workspaceDirectory
))
++
mapped
.
outputs
.
map
{
External
.
fetchOutputFiles
(
external
,
outputs
,
preparedContext
,
resolver
,
Seq
(
instance
.
workspaceDirectory
))
++
mapped
.
outputs
.
map
{
...
...
openmole/plugins/org.openmole.plugin.task.netlogo5/src/main/scala/org/openmole/plugin/task/netlogo5/NetLogo5Task.scala
View file @
c7f87ec1
...
@@ -43,7 +43,8 @@ object NetLogo5Task {
...
@@ -43,7 +43,8 @@ object NetLogo5Task {
def
workspace
(
def
workspace
(
workspace
:
File
,
workspace
:
File
,
script
:
String
,
script
:
String
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
@@ -52,7 +53,8 @@ object NetLogo5Task {
...
@@ -52,7 +53,8 @@ object NetLogo5Task {
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo5Task
=
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo5Task
=
withDefaultArgs
(
withDefaultArgs
(
workspace
=
Workspace
.
Directory
(
directory
=
workspace
,
script
=
script
,
name
=
workspace
.
getName
),
workspace
=
Workspace
.
Directory
(
directory
=
workspace
,
script
=
script
,
name
=
workspace
.
getName
),
launchingCommands
=
launchingCommands
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
seed
=
seed
,
ignoreError
=
ignoreError
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
reuseWorkspace
=
reuseWorkspace
,
...
@@ -64,7 +66,8 @@ object NetLogo5Task {
...
@@ -64,7 +66,8 @@ object NetLogo5Task {
def
file
(
def
file
(
script
:
File
,
script
:
File
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
@@ -73,7 +76,8 @@ object NetLogo5Task {
...
@@ -73,7 +76,8 @@ object NetLogo5Task {
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo5Task
=
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo5Task
=
withDefaultArgs
(
withDefaultArgs
(
workspace
=
Workspace
.
Script
(
script
=
script
,
name
=
script
.
getName
),
workspace
=
Workspace
.
Script
(
script
=
script
,
name
=
script
.
getName
),
launchingCommands
=
launchingCommands
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
seed
=
seed
,
ignoreError
=
ignoreError
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
reuseWorkspace
=
reuseWorkspace
,
...
@@ -85,7 +89,8 @@ object NetLogo5Task {
...
@@ -85,7 +89,8 @@ object NetLogo5Task {
def
apply
(
def
apply
(
script
:
File
,
script
:
File
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]]
=
Seq
(),
embedWorkspace
:
Boolean
=
false
,
embedWorkspace
:
Boolean
=
false
,
seed
:
OptionalArgument
[
Val
[
Int
]]
=
None
,
seed
:
OptionalArgument
[
Val
[
Int
]]
=
None
,
ignoreError
:
Boolean
=
false
,
ignoreError
:
Boolean
=
false
,
...
@@ -93,12 +98,13 @@ object NetLogo5Task {
...
@@ -93,12 +98,13 @@ object NetLogo5Task {
ignoreErrorOnDispose
:
Boolean
=
false
,
ignoreErrorOnDispose
:
Boolean
=
false
,
switch3d
:
Boolean
=
false
switch3d
:
Boolean
=
false
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo5Task
=
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo5Task
=
if
(
embedWorkspace
)
workspace
(
script
.
getCanonicalFile
.
getParentFile
,
script
.
getName
,
launchingCommands
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
if
(
embedWorkspace
)
workspace
(
script
.
getCanonicalFile
.
getParentFile
,
script
.
getName
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
else
file
(
script
,
launchingCommands
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
else
file
(
script
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
private
def
withDefaultArgs
(
private
def
withDefaultArgs
(
workspace
:
NetLogoTask.Workspace
,
workspace
:
NetLogoTask.Workspace
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
Option
[
Val
[
Int
]],
seed
:
Option
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
@@ -111,7 +117,8 @@ object NetLogo5Task {
...
@@ -111,7 +117,8 @@ object NetLogo5Task {
info
=
InfoConfig
(),
info
=
InfoConfig
(),
mapped
=
MappedInputOutputConfig
(),
mapped
=
MappedInputOutputConfig
(),
workspace
=
workspace
,
workspace
=
workspace
,
launchingCommands
=
launchingCommands
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
seed
=
seed
,
ignoreError
=
ignoreError
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
reuseWorkspace
=
reuseWorkspace
,
...
@@ -127,7 +134,8 @@ object NetLogo5Task {
...
@@ -127,7 +134,8 @@ object NetLogo5Task {
info
:
InfoConfig
,
info
:
InfoConfig
,
mapped
:
MappedInputOutputConfig
,
mapped
:
MappedInputOutputConfig
,
workspace
:
NetLogoTask.Workspace
,
workspace
:
NetLogoTask.Workspace
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
Option
[
Val
[
Int
]],
seed
:
Option
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
...
openmole/plugins/org.openmole.plugin.task.netlogo6/src/main/scala/org/openmole/plugin/task/netlogo6/NetLogo6Task.scala
View file @
c7f87ec1
...
@@ -43,7 +43,8 @@ object NetLogo6Task {
...
@@ -43,7 +43,8 @@ object NetLogo6Task {
def
workspace
(
def
workspace
(
workspace
:
File
,
workspace
:
File
,
script
:
String
,
script
:
String
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
@@ -52,7 +53,8 @@ object NetLogo6Task {
...
@@ -52,7 +53,8 @@ object NetLogo6Task {
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo6Task
=
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo6Task
=
withDefaultArgs
(
withDefaultArgs
(
workspace
=
Workspace
.
Directory
(
directory
=
workspace
,
script
=
script
,
name
=
workspace
.
getName
),
workspace
=
Workspace
.
Directory
(
directory
=
workspace
,
script
=
script
,
name
=
workspace
.
getName
),
launchingCommands
=
launchingCommands
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
seed
=
seed
,
ignoreError
=
ignoreError
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
reuseWorkspace
=
reuseWorkspace
,
...
@@ -64,7 +66,8 @@ object NetLogo6Task {
...
@@ -64,7 +66,8 @@ object NetLogo6Task {
def
file
(
def
file
(
script
:
File
,
script
:
File
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
seed
:
OptionalArgument
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
@@ -73,7 +76,8 @@ object NetLogo6Task {
...
@@ -73,7 +76,8 @@ object NetLogo6Task {
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo6Task
=
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo6Task
=
withDefaultArgs
(
withDefaultArgs
(
workspace
=
Workspace
.
Script
(
script
=
script
,
name
=
script
.
getName
),
workspace
=
Workspace
.
Script
(
script
=
script
,
name
=
script
.
getName
),
launchingCommands
=
launchingCommands
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
seed
=
seed
,
ignoreError
=
ignoreError
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
reuseWorkspace
=
reuseWorkspace
,
...
@@ -85,7 +89,8 @@ object NetLogo6Task {
...
@@ -85,7 +89,8 @@ object NetLogo6Task {
def
apply
(
def
apply
(
script
:
File
,
script
:
File
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]]
=
Seq
(),
embedWorkspace
:
Boolean
=
false
,
embedWorkspace
:
Boolean
=
false
,
seed
:
OptionalArgument
[
Val
[
Int
]]
=
None
,
seed
:
OptionalArgument
[
Val
[
Int
]]
=
None
,
ignoreError
:
Boolean
=
false
,
ignoreError
:
Boolean
=
false
,
...
@@ -93,12 +98,13 @@ object NetLogo6Task {
...
@@ -93,12 +98,13 @@ object NetLogo6Task {
ignoreErrorOnDispose
:
Boolean
=
false
,
ignoreErrorOnDispose
:
Boolean
=
false
,
switch3d
:
Boolean
=
false
switch3d
:
Boolean
=
false
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo6Task
=
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
NetLogo6Task
=
if
(
embedWorkspace
)
workspace
(
script
.
getCanonicalFile
.
getParentFile
,
script
.
getName
,
launchingCommands
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
if
(
embedWorkspace
)
workspace
(
script
.
getCanonicalFile
.
getParentFile
,
script
.
getName
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
else
file
(
script
,
launchingCommands
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
else
file
(
script
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
ignoreErrorOnDispose
=
ignoreErrorOnDispose
,
switch3d
=
switch3d
)
private
def
withDefaultArgs
(
private
def
withDefaultArgs
(
workspace
:
NetLogoTask.Workspace
,
workspace
:
NetLogoTask.Workspace
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
Option
[
Val
[
Int
]],
seed
:
Option
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
@@ -111,7 +117,8 @@ object NetLogo6Task {
...
@@ -111,7 +117,8 @@ object NetLogo6Task {
info
=
InfoConfig
(),
info
=
InfoConfig
(),
mapped
=
MappedInputOutputConfig
(),
mapped
=
MappedInputOutputConfig
(),
workspace
=
workspace
,
workspace
=
workspace
,
launchingCommands
=
launchingCommands
,
go
=
go
,
setup
=
setup
,
seed
=
seed
,
seed
=
seed
,
ignoreError
=
ignoreError
,
ignoreError
=
ignoreError
,
reuseWorkspace
=
reuseWorkspace
,
reuseWorkspace
=
reuseWorkspace
,
...
@@ -127,7 +134,8 @@ object NetLogo6Task {
...
@@ -127,7 +134,8 @@ object NetLogo6Task {
info
:
InfoConfig
,
info
:
InfoConfig
,
mapped
:
MappedInputOutputConfig
,
mapped
:
MappedInputOutputConfig
,
workspace
:
NetLogoTask.Workspace
,
workspace
:
NetLogoTask.Workspace
,
launchingCommands
:
Seq
[
FromContext
[
String
]],
go
:
Seq
[
FromContext
[
String
]],
setup
:
Seq
[
FromContext
[
String
]],
seed
:
Option
[
Val
[
Int
]],
seed
:
Option
[
Val
[
Int
]],
ignoreError
:
Boolean
,
ignoreError
:
Boolean
,
reuseWorkspace
:
Boolean
,
reuseWorkspace
:
Boolean
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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