1 #ifndef SEMANTIC_STEP_PROPOSAL_H_
2 #define SEMANTIC_STEP_PROPOSAL_H_
15 #include <boost/random/mersenne_twister.hpp>
16 #include <boost/random/discrete_distribution.hpp>
20 const double minimum = 0.001;
21 const double mutability = 0.3;
29 typedef boost::shared_ptr<Semantic_step_proposal>
Self_ptr;
34 typedef boost::tuple<Step_code_t, Elab_ptr_const, Sem_event_ptr, Syn_event_ptr>
39 static boost::mt19937
urng;
54 const bool& tree_is_altered,
55 const bool& collins =
false
69 const bool& tree_is_altered,
70 const bool& collins =
false
77 static double mp = minimum;
85 static double mp = mutability;
90 double prob(){
return prob_;}
94 void sample_a_proposal(
boost::shared_ptr< Syntactic_event > Event_ptr
Definition: Syntactic_event.h:27
Elaboration_tree::Elab_ptr_const Elab_ptr_const
Definition: Semantic_step_proposal.h:31
static const double & min_prob()
a smoothing factor
Definition: Semantic_step_proposal.h:75
Semantic_step_proposal::Proposal Proposal
Definition: Semantic_step_proposal.cpp:38
Proposal state()
Definition: Semantic_step_proposal.h:89
Definition: Semantic_step_proposal.h:26
Elaboration_tree::Step_result Step_result
Definition: Semantic_step_proposal.h:37
Semantic_elaboration::Step_result Step_result
Definition: Elaboration_tree.h:40
bool propose(const Elab_ptr_const semantic_parent, const Sem_event_ptr sem_event, const Syn_event_ptr syn_event, const Step_code_t &curr_step, const bool &tree_is_altered, const bool &collins=false)
generate a proposal and store the result and the log prob
Definition: Semantic_step_proposal.cpp:202
double prob()
Definition: Semantic_step_proposal.h:90
Semantic_step_event::Event_ptr Sem_event_ptr
Definition: Semantic_step_proposal.h:33
Semantic_elaboration::Self_ptr Elab_ptr
Definition: Elaboration_tree.h:33
Semantic_step_proposal()
Definition: Semantic_step_proposal.cpp:160
Semantic_step_proposal::Proposal_dist Proposal_dist
Definition: Semantic_step_proposal.cpp:41
double dist(const pt a, const pt b)
compute approx. Great Circle distance between two UTM points
Definition: layer.cpp:45
Elaboration_tree::Elab_ptr Elab_ptr
Definition: Semantic_step_proposal.h:30
static double evaluate_a_proposal(const Elab_ptr_const semantic_parent, const Sem_event_ptr sem_event, const Syn_event_ptr syn_event, const Step_code_t step, const bool &tree_is_altered, const bool &collins=false)
given the current step, compute the probability of proposing it
Definition: Semantic_step_proposal.cpp:226
boost::shared_ptr< Semantic_step_event > Event_ptr
Definition: Semantic_step_event.h:18
boost::array< Proposal, Step_code::NUM_STEPS > Proposal_array
Definition: Semantic_step_proposal.h:36
Semantic_step_proposal::Proposal_array Proposal_array
Definition: Semantic_step_proposal.cpp:39
boost::random::discrete_distribution Proposal_dist
Definition: Semantic_step_proposal.h:38
static const double & mutability_prob()
probability of initiating a move for a subtree
Definition: Semantic_step_proposal.h:83
boost::shared_ptr< Semantic_step_proposal > Self_ptr
Definition: Semantic_step_proposal.h:29
static boost::mt19937 urng
Definition: Semantic_step_proposal.h:39
static bool VERBOSE
Member definitions.
Definition: Semantic_step_proposal.h:40
Semantic_elaboration::Self_ptr_const Elab_ptr_const
Definition: Elaboration_tree.h:34
Code
Definition: SemanticIO.h:54
Syntactic_event::Event_ptr Syn_event_ptr
Definition: Semantic_step_proposal.h:32
boost::tuple< Step_code_t, Elab_ptr_const, Sem_event_ptr, Syn_event_ptr > Proposal
Definition: Semantic_step_proposal.h:35