Skip to content

Commit 2035143

Browse files
authored
Merge pull request #404 from avinxshKD/fix/simtime-double-370
fix: use double for simtime/maxtime in concoredocker.hpp
2 parents a51d841 + 6a40d0f commit 2035143

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

concoredocker.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class Concore {
2323
int retrycount = 0;
2424
std::string inpath = "/in";
2525
std::string outpath = "/out";
26-
int simtime = 0;
27-
int maxtime = 100;
26+
double simtime = 0;
27+
double maxtime = 100;
2828
std::unordered_map<std::string, std::string> params;
2929

3030
std::string stripstr(const std::string& str) {
@@ -119,7 +119,7 @@ class Concore {
119119
return params.count(n) ? params[n] : i;
120120
}
121121

122-
void default_maxtime(int defaultValue) {
122+
void default_maxtime(double defaultValue) {
123123
maxtime = defaultValue;
124124
std::ifstream file(inpath + "/1/concore.maxtime");
125125
if (file) {
@@ -166,7 +166,7 @@ class Concore {
166166
try {
167167
std::vector<std::string> inval = parselist(ins);
168168
if (!inval.empty()) {
169-
int file_simtime = (int)std::stod(inval[0]);
169+
double file_simtime = std::stod(inval[0]);
170170
simtime = std::max(simtime, file_simtime);
171171
return std::vector<std::string>(inval.begin() + 1, inval.end());
172172
}
@@ -195,7 +195,7 @@ class Concore {
195195
try {
196196
std::vector<std::string> val = parselist(simtime_val);
197197
if (!val.empty()) {
198-
simtime = (int)std::stod(val[0]);
198+
simtime = std::stod(val[0]);
199199
return std::vector<std::string>(val.begin() + 1, val.end());
200200
}
201201
} catch (...) {}

0 commit comments

Comments
 (0)