Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
moex
Alignment API
Commits
9a6c0b73
Commit
9a6c0b73
authored
15 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- corrected two bugs which prevented drop to work
parent
4b689a74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fr/inrialpes/exmo/align/util/OntologyNetworkWeakener.java
+5
-1
5 additions, 1 deletion
...fr/inrialpes/exmo/align/util/OntologyNetworkWeakener.java
with
5 additions
and
1 deletion
src/fr/inrialpes/exmo/align/util/OntologyNetworkWeakener.java
+
5
−
1
View file @
9a6c0b73
...
@@ -102,6 +102,7 @@ public class OntologyNetworkWeakener {
...
@@ -102,6 +102,7 @@ public class OntologyNetworkWeakener {
* Returns a brand new BasicOntologyNetwork (with the initial alignments)
* Returns a brand new BasicOntologyNetwork (with the initial alignments)
*/
*/
public
static
OntologyNetwork
dropAlignments
(
OntologyNetwork
on
,
double
n
)
throws
AlignmentException
{
public
static
OntologyNetwork
dropAlignments
(
OntologyNetwork
on
,
double
n
)
throws
AlignmentException
{
System
.
err
.
println
(
" >>>> "
+
n
);
if
(
n
<
0
.
||
n
>
1
.
)
if
(
n
<
0
.
||
n
>
1
.
)
throw
new
AlignmentException
(
"Argument must be between 0 and 1.: "
+
n
);
throw
new
AlignmentException
(
"Argument must be between 0 and 1.: "
+
n
);
OntologyNetwork
newon
=
new
BasicOntologyNetwork
();
OntologyNetwork
newon
=
new
BasicOntologyNetwork
();
...
@@ -111,9 +112,12 @@ public class OntologyNetworkWeakener {
...
@@ -111,9 +112,12 @@ public class OntologyNetworkWeakener {
Set
<
Alignment
>
alignments
=
on
.
getAlignments
();
Set
<
Alignment
>
alignments
=
on
.
getAlignments
();
int
size
=
alignments
.
size
();
int
size
=
alignments
.
size
();
ArrayList
<
Alignment
>
array
=
new
ArrayList
<
Alignment
>(
size
);
ArrayList
<
Alignment
>
array
=
new
ArrayList
<
Alignment
>(
size
);
for
(
Alignment
al
:
alignments
){
array
.
add
(
al
);
}
Collections
.
shuffle
(
array
);
Collections
.
shuffle
(
array
);
for
(
int
i
=
size
-
(
int
)(
n
*
size
);
i
>
0
;
i
--
)
{
for
(
int
i
=
size
-
(
int
)(
n
*
size
);
i
>
0
;
i
--
)
{
on
.
addAlignment
(
array
.
get
(
i
)
);
new
on
.
addAlignment
(
array
.
get
(
i
)
);
}
}
return
newon
;
return
newon
;
}
}
...
...
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