Skip to content

Commit dd479f2

Browse files
author
Andreagiovanni Reina
committed
Improved python code and committed light dimmer data.
* Added possibility compute confidence from normal distribution of drifts. * Added type to allow RGG with fixed degree. * Added possibility to compute DDM's threshold from Bayes Risk * Added possibility to include prior
1 parent 8a8ee13 commit dd479f2

128 files changed

Lines changed: 159934 additions & 163 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pydevproject

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
44
<path>/${PROJECT_DIR_NAME}/src</path>
55
</pydev_pathproperty>
6-
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.0</pydev_property>
6+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
77
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">conda</pydev_property>
88
<pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
99
<path>/Users/joefresna/anaconda/lib/python3.5/site-packages/networkx</path>

conf/AsynchK.config

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@ truncatePoor=true
2222

2323
[DDM]
2424
# possible driftDistributions are [ 'uniform', 'normal', 'from_accuracy' ]
25-
driftDistribution=uniform
25+
driftDistribution=normal
2626
baseDrift=0.1
27-
driftStdDev=0.5
28-
randomDriftRangeMin=-1.5
29-
randomDriftRangeMax=1.5
27+
driftStdDev=1
28+
randomDriftRangePlusMinus=1.5
3029
noiseStdDev=0.5
3130
dt=0.01
3231
threshold=10
33-
prior=0.6
32+
prior=0.5
33+
useBayesRisk=true
34+
# costMatrix accepts two values [ timeCost, errorCost ]
35+
costMatrix=[ 1 , 20 ]
3436

3537
[Network]
3638
number_of_nodes=20
37-
# possible netTypes are [ 'full' , 'erdos-renyi', 'barabasi-albert', 'space', 'soft-rgg', 'from-file', 'from-file-fixComm' ]
39+
# possible netTypes are [ 'full' , 'erdos-renyi', 'barabasi-albert', 'space', 'soft-rgg', 'from-file', 'from-file-fixComm', 'rgg-fixed-degree' ]
3840
netType=space
3941
number_of_edges=20
4042
link_probability=0.4

conf/AsynchK.template.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ truncatePoor=ACC_TRUNCATED
2323
driftDistribution=DDM_DRIFT_DIST
2424
baseDrift=DDM_BASE_DRIFT
2525
driftStdDev=DDM_DRIFT_STD_DEV
26-
randomDriftRangeMin=DDM_DRIFT_RANGE_MIN
27-
randomDriftRangeMax=DDM_DRIFT_RANGE_MAX
26+
randomDriftRangePlusMinus=DDM_DRIFT_RANGE_PLUS_MINUS
2827
noiseStdDev=DDM_NOISE_STD_DEV
2928
dt=0.01
3029
threshold=THRESHOLD
30+
prior=PRIOR_DIST
31+
useBayesRisk=USE_BAYES_RISK
32+
costMatrix=[ COST_MATRIX_T , COST_MATRIX_E ]
3133

3234
[Network]
3335
number_of_nodes=NUM_NODES

conf/DecNet.config

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
[experiment]
22
randomSeed=2289
3-
#2289
43
# bad case for space with size 1 and range 0.3 seed: 1670054
5-
numberOfExperiments=6
4+
numberOfExperiments=1
65
repetitionsPerDDM=1
76
outputTxtFile=../../data/out.txt
87
outputPdfFile=../../data/output
98
cluster=false
109

1110
[Agent]
1211
# possible agentTypes are [ 'simple' , 'DDM' ]
13-
agentType=simple
12+
agentType=DDM
1413
# possible decisionModels are [ 'conf-perfect', 'majority-rand', 'majority-bias', 'majority-inhibit', 'best-acc', 'best-conf', 'log-odds-perfect', 'log-odds-combo', 'log-odds-distr', 'log-odds-approx', 'belief' ]
15-
decisionModel=conf-perfect
14+
decisionModel=log-odds-distr
1615
max_iterations=100
1716
# possible updateConfs are [ 'no-up', 'theta-up', 'theta-norm', 'optim-up', 'belief-up', 'finite-time' ]
18-
updateConf=finite-time
17+
updateConf=optim-up
1918
beliefEpsilon=0
2019
finiteTimeExponent=0.5
2120

@@ -29,21 +28,24 @@ truncatePoor=true
2928
driftDistribution=from_accuracy
3029
baseDrift=0.1
3130
driftStdDev=0.5
32-
randomDriftRangeMin=-1
33-
randomDriftRangeMax=1
31+
randomDriftRangePlusMinus=1
3432
noiseStdDev=0.5
3533
dt=0.01
3634
threshold=1
37-
interrogationTime=2
35+
interrogationTimeFromAccuracy=true
36+
interrogationTime=0.6
37+
prior=0.5
38+
# costMatrix accepts two values [ timeCost, errorCost ]
39+
costMatrix=[ 1 , 20 ]
3840

3941
[Network]
4042
number_of_nodes=60
41-
# possible netTypes are [ 'full' , 'erdos-renyi', 'barabasi-albert', 'space', 'soft-rgg', 'from-file', 'from-file-fixComm' ]
42-
netType=space
43+
# possible netTypes are [ 'full' , 'erdos-renyi', 'barabasi-albert', 'space', 'soft-rgg', 'from-file', 'from-file-fixComm', 'rgg-fixed-degree' ]
44+
netType=rgg-fixed-degree
4345
number_of_edges=20
4446
link_probability=0.4
4547
area_size=1
46-
communication_radius=0.25
48+
communication_radius=10
4749
coordinates_file=../../kilobots/data/log_confsens_keep2.txt
4850
periodic=false
4951

conf/DecNet.template.config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ truncatePoor=ACC_TRUNCATED
2727
driftDistribution=DDM_DRIFT_DIST
2828
baseDrift=DDM_BASE_DRIFT
2929
driftStdDev=DDM_DRIFT_STD_DEV
30-
randomDriftRangeMin=DDM_DRIFT_RANGE_MIN
31-
randomDriftRangeMax=DDM_DRIFT_RANGE_MAX
30+
randomDriftRangePlusMinus=DDM_DRIFT_RANGE_PLUS_MINUS
3231
noiseStdDev=DDM_NOISE_STD_DEV
3332
dt=0.01
3433
threshold=1

kilobots/.qmake.stash

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
QMAKE_DEFAULT_INCDIRS = \
2+
C:/Qt/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include \
3+
C:/Qt/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include-fixed \
4+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include \
5+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++ \
6+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32 \
7+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward
8+
QMAKE_DEFAULT_LIBDIRS = \
9+
C \
10+
/Qt/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/;C \
11+
/Qt/Tools/mingw530_32/lib/gcc/;C \
12+
/Qt/Tools/mingw530_32/i686-w64-mingw32/lib/;C \
13+
/Qt/Tools/mingw530_32/lib/;C \
14+
/Qt/Tools/mingw530_32/lib

kilobots/Arduino dimmer.rar

16.9 MB
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
int outputPin = 9;
3+
String incomingByte;
4+
int inputNumber;
5+
6+
void setup() {
7+
Serial.begin(9600);
8+
pinMode(outputPin, OUTPUT);
9+
}
10+
11+
void loop() {
12+
13+
if (Serial.available() > 0) {
14+
15+
incomingByte = Serial.readString();
16+
inputNumber = incomingByte.toInt();
17+
18+
Serial.print("I received: ");
19+
Serial.println(inputNumber);
20+
21+
if((inputNumber >= 0) && (inputNumber <= 255)){
22+
analogWrite(outputPin, inputNumber);
23+
Serial.println("Sending");
24+
}else{
25+
Serial.println("Error: The number should be 0<number<255");
26+
}
27+
}
28+
}
29+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
QMAKE_DEFAULT_INCDIRS = \
2+
C:/Qt/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include \
3+
C:/Qt/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include-fixed \
4+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include \
5+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++ \
6+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32 \
7+
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward
8+
QMAKE_DEFAULT_LIBDIRS = \
9+
C \
10+
/Qt/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/;C \
11+
/Qt/Tools/mingw530_32/lib/gcc/;C \
12+
/Qt/Tools/mingw530_32/i686-w64-mingw32/lib/;C \
13+
/Qt/Tools/mingw530_32/lib/;C \
14+
/Qt/Tools/mingw530_32/lib

0 commit comments

Comments
 (0)