Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mattxwang committed Jul 17, 2023
1 parent d440781 commit c00887e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 18 additions & 2 deletions examples/rsbn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,25 @@ extern crate serde;
extern crate serde_json;

use clap::Parser;
use rsdd::{builder::{decision_nnf::{StandardDecisionNNFBuilder, DecisionNNFBuilder}, sdd::{CompressionSddBuilder, SddBuilder}, bdd::{RobddBuilder, BddBuilder}, cache::all_app::AllTable, BottomUpBuilder}, repr::{var_order::VarOrder, ddnnf::DDNNFPtr, vtree::VTree, dtree::DTree, bdd::BddPtr, var_label::{Literal, VarLabel}}};
use rsdd::{
builder::{
bdd::{BddBuilder, RobddBuilder},
cache::all_app::AllTable,
decision_nnf::{DecisionNNFBuilder, StandardDecisionNNFBuilder},
sdd::{CompressionSddBuilder, SddBuilder},
BottomUpBuilder,
},
repr::{
bdd::BddPtr,
ddnnf::DDNNFPtr,
dtree::DTree,
var_label::{Literal, VarLabel},
var_order::VarOrder,
vtree::VTree,
},
};
use rsgm::{BayesianNetwork, BayesianNetworkCNF};
use std::{fs, time::Instant, collections::HashMap};
use std::{collections::HashMap, fs, time::Instant};

/// Processes a JSON Bayesian network generated by `converter`
#[derive(Parser, Debug)]
Expand Down
6 changes: 5 additions & 1 deletion src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ impl BayesianNetworkCNF {

for parent_assignment in network.parent_assignments(&variable) {
let cur_param = VarLabel::new_usize(var_count);
let cur_prob = network.conditional_probability(&variable, variable_assignment, &parent_assignment);
let cur_prob = network.conditional_probability(
&variable,
variable_assignment,
&parent_assignment,
);
wmc_params.insert(cur_param, (RealSemiring::one(), RealSemiring(cur_prob)));
var_count += 1;

Expand Down

0 comments on commit c00887e

Please sign in to comment.