-
Notifications
You must be signed in to change notification settings - Fork 2
/
multiRoverIntrospection.cpp
71 lines (55 loc) · 2 KB
/
multiRoverIntrospection.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>
#include <vector>
#include <string>
#include <Eigen/Eigen>
#include "Domains/MultiRover.h"
using std::vector ;
using std::string ;
using namespace Eigen ;
int main(){
std::cout << "***** Multi-rover introspection and assistance request experiments *****\n" ;
vector<double> world ;
world.push_back(0.0) ;
world.push_back(100.0) ;
world.push_back(0.0) ;
world.push_back(100.0) ;
int trialNum = 11 ;
size_t nPOIs = 25 ;
size_t nSteps = 1000 ;
size_t nPop = 15 ;
size_t rovs = 5 ;
string evalFunc = "D" ;
size_t nEps = 1000 ;
MultiRover testDomain(world, nSteps, nPop, nPOIs, evalFunc, rovs) ;
int buffSize = 100 ;
char fileDir[buffSize] ;
sprintf(fileDir,"Results/100_square/Random_worlds/%d_epochs/MultiRover/%s/%d",(int)nEps,evalFunc.c_str(),0) ;
char NNFile[buffSize] ;
sprintf(NNFile,"%s/NNs.txt",fileDir) ;
char eeFile[buffSize] ;
sprintf(eeFile,"%s/results_test_%d.txt",fileDir,trialNum) ;
char ttFile[buffSize] ;
sprintf(ttFile,"%s/trajectories_test_%d.txt",fileDir,trialNum) ;
char ppFile[buffSize] ;
sprintf(ppFile,"%s/POIs_test_%d.txt",fileDir,trialNum) ;
char ddFile[buffSize] ;
sprintf(ddFile,"%s/avgD_test_%d.txt",fileDir,trialNum) ;
testDomain.OutputAverageStepwise(ddFile) ; // store average stepwise D values
char qqFile[buffSize] ;
sprintf(qqFile,"%s/queries_test_%d.txt",fileDir,trialNum) ;
char bbFile[buffSize] ;
sprintf(bbFile,"%s/beliefs_test_%d.txt",fileDir,trialNum) ;
char pomdpDir[buffSize] ;
sprintf(pomdpDir,"../include/POMDPs") ;
char envFile[buffSize] ;
sprintf(envFile,"%s/rover_6.pomdp",pomdpDir) ;
char polFile[buffSize] ;
sprintf(polFile,"%s/rover_6.policy",pomdpDir) ;
VectorXd prior ;
prior.setZero(2) ;
prior(0) = 0.1 ;
prior(1) = 1.0 - prior(0) ; // begin with high expectation of being an expert
testDomain.ExecutePolicies(NNFile, ttFile, ppFile, eeFile, qqFile, bbFile, 8, 2, 16, 0, envFile, polFile, prior) ;
std::cout << "Test complete!\n" ;
return 0 ;
}