Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
eb348085
Commit
eb348085
authored
14 years ago
by
Aurélien Bricier
Browse files
Options
Downloads
Patches
Plain Diff
TEST: added more tests on otbJointMassOfBeliefFilter
parent
b83178d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/Code/Fuzzy/CMakeLists.txt
+31
-2
31 additions, 2 deletions
Testing/Code/Fuzzy/CMakeLists.txt
Testing/Code/Fuzzy/otbMassOfBeliefDSApplied.cxx
+30
-29
30 additions, 29 deletions
Testing/Code/Fuzzy/otbMassOfBeliefDSApplied.cxx
with
61 additions
and
31 deletions
Testing/Code/Fuzzy/CMakeLists.txt
+
31
−
2
View file @
eb348085
...
...
@@ -45,8 +45,37 @@ ADD_TEST(fzTvJointMassOfBeliefFilter ${Fuzzy_TESTS1}
ADD_TEST
(
fzTvFuzzyVariableDSApplied
${
Fuzzy_TESTS2
}
otbFuzzyVariableDSApplied
)
ADD_TEST
(
fzTvMassOfBeliefDSApplied
${
Fuzzy_TESTS2
}
otbMassOfBeliefDSApplied
)
ADD_TEST
(
fzTvMassOfBeliefDSApplied-H1H2
${
Fuzzy_TESTS2
}
otbMassOfBeliefDSApplied
"H1"
# describe the hypothesis
"H2"
# here the hypothesis is {H1, H2}
0.9
0.9
)
ADD_TEST
(
fzTvMassOfBeliefDSApplied-H1H2_
${
Fuzzy_TESTS2
}
otbMassOfBeliefDSApplied
"H1"
"H2_"
# here the hypothesis is {H1, H2_}
0.9
0.9
)
ADD_TEST
(
fzTvMassOfBeliefDSApplied-H1_H2
${
Fuzzy_TESTS2
}
otbMassOfBeliefDSApplied
"H1_"
"H2"
# here the hypothesis is {H1_, H2}
0.9
0.9
)
ADD_TEST
(
fzTvMassOfBeliefDSApplied-H1_H2_
${
Fuzzy_TESTS2
}
otbMassOfBeliefDSApplied
"H1_"
"H2_"
# here the hypothesis is {H1_, H2_}
0.9
0.9
)
#ADD_TEST(fzTuVectorDataToSpecificDescriptionFilterBaseNew ${Fuzzy_TESTS2}
# otbVectorDataToSpecificDescriptionFilterBaseNew)
...
...
This diff is collapsed.
Click to expand it.
Testing/Code/Fuzzy/otbMassOfBeliefDSApplied.cxx
+
30
−
29
View file @
eb348085
...
...
@@ -26,14 +26,19 @@
int
otbMassOfBeliefDSApplied
(
int
argc
,
char
*
argv
[])
{
const
char
*
hyp_1
=
argv
[
1
];
const
char
*
hyp_2
=
argv
[
2
];
double
desc1Val
=
atof
(
argv
[
3
]);
double
desc2Val
=
atof
(
argv
[
4
]);
typedef
float
PrecisionType
;
typedef
otb
::
FuzzyVariable
<
std
::
string
,
PrecisionType
>
FuzzyVarType
;
typedef
otb
::
FuzzyVariable
<
std
::
string
,
PrecisionType
>
FuzzyVarType
;
typedef
otb
::
MassOfBelief
<
std
::
string
>
MassOfBeliefFunctionType
;
typedef
otb
::
JointMassOfBeliefFilter
<
MassOfBeliefFunctionType
>
JointMassOfBeliefFilterType
;
typedef
otb
::
JointMassOfBeliefFilter
<
MassOfBeliefFunctionType
>
JointMassOfBeliefFilterType
;
// Descriptors and associated fuzzy variables
FuzzyVarType
::
Pointer
desc1
=
FuzzyVarType
::
New
();
FuzzyVarType
::
Pointer
desc2
=
FuzzyVarType
::
New
();
...
...
@@ -43,22 +48,23 @@ int otbMassOfBeliefDSApplied(int argc, char* argv[])
desc2
->
SetMembership
(
"H2"
,
0
,
0
,
0.58
,
0.68
,
0
,
0.99
);
desc2
->
SetMembership
(
"H2_"
,
0.68
,
0.98
,
1.0
,
1.0
,
0
,
0.99
);
PrecisionType
desc1Val
=
0.9
;
PrecisionType
desc2Val
=
0.9
;
// Corresponding masses
MassOfBeliefFunctionType
::
Pointer
mass1
=
MassOfBeliefFunctionType
::
New
();
MassOfBeliefFunctionType
::
Pointer
mass2
=
MassOfBeliefFunctionType
::
New
();
MassOfBeliefFunctionType
::
Pointer
jointMass
=
MassOfBeliefFunctionType
::
New
();
MassOfBeliefFunctionType
::
LabelSetType
H1
,
H1_
,
H2
,
H2_
,
universe
,
Hyp
;
// Defining universe
universe
.
insert
(
"H1"
);
universe
.
insert
(
"H1_"
);
universe
.
insert
(
"H2"
);
universe
.
insert
(
"H2_"
);
Hyp
.
insert
(
"H1"
);
Hyp
.
insert
(
"H2_"
);
// Studied hypothesis
Hyp
.
insert
(
hyp_1
);
Hyp
.
insert
(
hyp_2
);
// Initialize masses
mass1
->
InitializePowerSetMasses
(
universe
);
mass2
->
InitializePowerSetMasses
(
universe
);
...
...
@@ -82,22 +88,11 @@ int otbMassOfBeliefDSApplied(int argc, char* argv[])
jointMass
=
jointMassFilter
->
GetOutput
();
std
::
cout
<<
mass1
<<
std
::
endl
;
std
::
cout
<<
"["
<<
desc1
->
GetMembership
(
"H1"
,
desc1Val
)
<<
","
<<
desc1
->
GetMembership
(
"H1_"
,
desc1Val
)
<<
"]"
<<
std
::
endl
;
std
::
cout
<<
mass2
<<
std
::
endl
;
std
::
cout
<<
"["
<<
desc2
->
GetMembership
(
"H2"
,
desc2Val
)
<<
","
<<
desc2
->
GetMembership
(
"H2_"
,
desc2Val
)
<<
"]"
<<
std
::
endl
;
std
::
cout
<<
jointMass
<<
std
::
endl
;
std
::
cout
<<
"Considered Hypothesis : "
<<
Hyp
<<
std
::
endl
;
std
::
cout
<<
"Belief(Hyp) : "
<<
jointMass
->
GetBelief
(
Hyp
)
<<
" - Plausibility(Hyp) : "
...
...
@@ -105,8 +100,14 @@ int otbMassOfBeliefDSApplied(int argc, char* argv[])
<<
" - Score(Hyp) : "
<<
(
jointMass
->
GetBelief
(
Hyp
)
+
jointMass
->
GetPlausibility
(
Hyp
))
/
2.0
<<
std
::
endl
;
return
EXIT_SUCCESS
;
if
(
jointMass
->
GetBelief
(
Hyp
)
>
jointMass
->
GetPlausibility
(
Hyp
))
{
std
::
cout
<<
"Belief > Plausibility"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
else
{
return
EXIT_SUCCESS
;
}
}
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