Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
basic-example
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
davis
basic-example
Commits
864f016d
Commit
864f016d
authored
6 years ago
by
Emmanuel Godard
Browse files
Options
Downloads
Patches
Plain Diff
default simple davis task
parent
41278209
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+19
-9
19 additions, 9 deletions
README.md
build.gradle
+19
-2
19 additions, 2 deletions
build.gradle
with
38 additions
and
11 deletions
README.md
+
19
−
9
View file @
864f016d
# Basic example of using Davis
# Basic example of using Davis
## Without IDE
1.
Write your java algorithm into the src folder :
`MyAlgo.java`
2.
Modify
`args`
parameters for task
`davis`
in
`build.gradle`
.
3.
Run
```
./gradlew davis
```
You can collect all your examples in
`scenario`
file
1.
Open
`scr/scenario`
file and add a line with 5 parameters :
`<scenarioName> <networkGeneratorFile> <scheme> <size> <algoFile : MyAlgo.java>`
3.
Execute in a terminal with
`./gradlew runscenarioName`
## Getting started with Intellij
## Getting started with Intellij
1.
Clone the basic example repository :
1.
Clone the basic example repository :
```
```
git clone https://gitlab.lis-lab.fr/davis/basic-example.git
git clone https://gitlab.lis-lab.fr/davis/basic-example.git
```
```
2.
Open IntelliJ and load project :
2.
Open IntelliJ and load project :
```
```
File/Open
File/Open
```
```
Choose the basic-example folder and click ok
Choose the basic-example folder and click ok
for
*auto-import*
.
## Write new algorithm
## Write new algorithm
1.
Write your java algorithm into the src folder : MyAlgo.java
1.
Write your java algorithm into the src folder :
`
MyAlgo.java
`
2.
Open scenario file and add a line with 5 parameters :
2.
Open scenario file and add a line with 5 parameters :
`<testName> <networkGeneratorFile> <scheme> <size> <algoFile : MyAlgo.java>`
`<testName> <networkGeneratorFile> <scheme> <size> <algoFile : MyAlgo.java>`
3.
Refresh gradle panel.
3.
Refresh gradle panel.
...
@@ -26,12 +42,6 @@ gradle task named "runtestName"
...
@@ -26,12 +42,6 @@ gradle task named "runtestName"
5.
Click to execute.
5.
Click to execute.
## Without Intellij
1.
Write your java algorithm into the src folder : MyAlgo.java
2.
Open scenario file and add a line with 5 parameters :
`<testName> <networkGeneratorFile> <scheme> <size> <algoFile : MyAlgo.java>`
3.
Execute in a terminal with
`./gradlew runtestName`
...
...
This diff is collapsed.
Click to expand it.
build.gradle
+
19
−
2
View file @
864f016d
...
@@ -9,6 +9,22 @@ apply plugin: "java"
...
@@ -9,6 +9,22 @@ apply plugin: "java"
apply
plugin:
"idea"
apply
plugin:
"idea"
apply
plugin:
"application"
apply
plugin:
"application"
// Install jbotsim locally in libs/lib
task
installJBotsim
(
type:
Copy
,
group:
"distribution"
,
description:
"Install jbotsim locally"
){
dependsOn
installDist
from
'build/install/basic-example/lib/'
include
'jbotsim-*'
into
'libs/lib'
}
// Basic task to launch davis with appropriate arguments :
// <network> <id> <size> <algo>
task
davis
(
type:
Exec
,
group:
"Application"
,
description:
"Run default Davis"
)
{
commandLine
'libs/bin/udavis'
,
'src/RingAnon2AgentsSym.java'
,
'RandomIds'
,
'18'
,
'src/randomWalkRing.java'
dependsOn
installJBotsim
}
def
davisFiles
=
"${projectDir}/libs/"
def
davisFiles
=
"${projectDir}/libs/"
println
(
"${davisFiles}"
)
println
(
"${davisFiles}"
)
...
@@ -31,6 +47,7 @@ repositories {
...
@@ -31,6 +47,7 @@ repositories {
task
downloadZipFile
(
type:
Download
)
{
task
downloadZipFile
(
type:
Download
)
{
src
'http://pageperso.lif.univ-mrs.fr/~emmanuel.godard/udavis-0.7rc1.zip'
src
'http://pageperso.lif.univ-mrs.fr/~emmanuel.godard/udavis-0.7rc1.zip'
dest
new
File
(
'libs'
,
'udavis-0.7rc1.zip'
)
dest
new
File
(
'libs'
,
'udavis-0.7rc1.zip'
)
overwrite
false
// to download only once
}
}
task
downloadAndUnzipFile
(
dependsOn:
downloadZipFile
,
type:
Copy
)
{
task
downloadAndUnzipFile
(
dependsOn:
downloadZipFile
,
type:
Copy
)
{
...
@@ -58,8 +75,8 @@ dependencies {
...
@@ -58,8 +75,8 @@ dependencies {
//Define integrationTest sources and ressources
//Define integrationTest sources and ressources
sourceSets
.
main
.
java
.
srcDir
(
'src'
)
sourceSets
.
main
.
java
.
srcDir
(
'src'
)
setMainClassName
(
'Main'
)
// Unset default MainClass
setMainClassName
(
''
)
ext
.
visitExamples
=
{
scripts
->
ext
.
visitExamples
=
{
scripts
->
def
srcDirectoryPath
=
"${rootProject.projectDir}"
+
File
.
separator
+
"src"
+
File
.
separator
def
srcDirectoryPath
=
"${rootProject.projectDir}"
+
File
.
separator
+
"src"
+
File
.
separator
...
...
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