improve a calculation of feature probability

This commit is contained in:
2022-10-12 20:51:07 +09:00
parent df6302c699
commit b61b6dd21b
4 changed files with 29 additions and 14 deletions

View File

@@ -20,8 +20,8 @@ HelpFlag help {
ValueFlag<size_t> dur {
parser, "100", "duration", {"dur"}, 100,
};
ValueFlag<size_t> fcnum {
parser, "50", "number of feature code alphabet", {"fc-num"}, 50,
ValueFlag<size_t> fnum {
parser, "50", "number of feature code alphabet", {"fnum"}, 50,
};
ValueFlag<size_t> branch {
parser, "2", "number of branch", {"branch"}, 2,
@@ -51,7 +51,7 @@ Flag inc_time {
size_t Step(size_t t, size_t c, size_t b) {
const auto fcnum = args::get(param::fcnum);
const auto fnum = args::get(param::fnum);
size_t ret;
switch (args::get(param::algo)) {
@@ -60,7 +60,7 @@ size_t Step(size_t t, size_t c, size_t b) {
if (param::inc_time) {
ret += t;
}
return ret%fcnum;
return ret%fnum;
default:
assert(false);
@@ -70,7 +70,7 @@ size_t Step(size_t t, size_t c, size_t b) {
void Exec() {
for (size_t t = 0; t < args::get(param::dur); ++t) {
for (size_t c = 0; c < args::get(param::fcnum); ++c) {
for (size_t c = 0; c < args::get(param::fnum); ++c) {
for (size_t b = 0; b < args::get(param::branch); ++b) {
std::cout << Step(t, c, b) << ' ';
}