private void updateLinksPreferredByUI() { if (this.steinerTree == null) return; // Change the status of previously preferred links to normal Set<LabeledLink> linksInPreviousTree = this.getLinksByStatus(LinkStatus.PreferredByUI); Set<LabeledLink> linksForcedByUser = this.getLinksByStatus(LinkStatus.ForcedByUser); if (linksInPreviousTree != null) { LabeledLink[] links = linksInPreviousTree.toArray(new LabeledLink[0]); for (LabeledLink link : links) this.graphBuilder.changeLinkStatus(link, LinkStatus.Normal); } for (LabeledLink link: this.steinerTree.edgeSet()) { if (linksForcedByUser == null || !linksForcedByUser.contains(link)) { this.graphBuilder.changeLinkStatus(link, LinkStatus.PreferredByUI); logger.debug("link " + link.getId() + " has been added to preferred UI links."); } } }
if (this.getLinksByStatus(LinkStatus.ForcedByUser) != null) { for (LabeledLink link: this.getLinksByStatus(LinkStatus.ForcedByUser)) logger.debug("\t" + link.getId());
TreePostProcess treePostProcess = new TreePostProcess(this.graphBuilder, tree, getLinksByStatus(LinkStatus.ForcedByUser), true);
Set<LabeledLink> linksForcedByUser = this.getLinksByStatus(LinkStatus.ForcedByUser); if (linksForcedByUser != null) { for (LabeledLink link : linksForcedByUser) {
private void addForcedLinks() { Set<LabeledLink> forcedLinks = getLinksByStatus(LinkStatus.ForcedByUser); if (forcedLinks != null) for (LabeledLink link : forcedLinks) { if (!this.steinerTree.containsEdge(link)) { if (!this.steinerTree.containsVertex(link.getSource())) { this.steinerTree.addVertex(link.getSource()); } if (!this.steinerTree.containsVertex(link.getTarget())) { this.steinerTree.addVertex(link.getTarget()); } this.steinerTree.addEdge(link.getSource(), link.getTarget(), link); } } }
modelLearner = new ModelLearner(alignment.getGraphBuilder(), steinerNodes); else modelLearner = new ModelLearner(ontologyManager, alignment.getLinksByStatus(LinkStatus.ForcedByUser), steinerNodes);