| … | … | @@ -327,8 +327,8 @@ HandlePair Aggregate::connect_section(const Handle& fm_sect, |
| 327 | 327 | // logger().fine("Connect %s\nto %s", |
| 328 | 328 | // fm_sect->to_string().c_str(), to_sect->to_string().c_str()); |
| 329 | 329 | logger().fine("Connect fm-offset=%lu:", offset); |
| 330 | Frame::print_section(fm_sect); | |
| 331 | Frame::print_section(to_sect); | |
| 330 | OdoFrame::print_section(fm_sect); | |
| 331 | OdoFrame::print_section(to_sect); | |
| 332 | 332 | |
| 333 | 333 | const Handle& fm_point = fm_sect->getOutgoingAtom(0); |
| 334 | 334 | const Handle& to_point = to_sect->getOutgoingAtom(0); |
| … | … | @@ -25,7 +25,7 @@ |
| 25 | 25 | #include <set> |
| 26 | 26 | |
| 27 | 27 | #include <opencog/atomspace/AtomSpace.h> |
| 28 | #include <opencog/generate/Frame.h> | |
| 28 | #include <opencog/generate/Odometer.h> | |
| 29 | 29 | #include <opencog/generate/GenerateCallback.h> |
| 30 | 30 | |
| 31 | 31 | namespace opencog |
| … | … | @@ -44,10 +44,10 @@ private: |
| 44 | 44 | GenerateCallback* _cb; |
| 45 | 45 | |
| 46 | 46 | /// Current traversal state |
| 47 | Frame _frame; | |
| 47 | OdoFrame _frame; | |
| 48 | 48 | Odometer _odo; |
| 49 | 49 | |
| 50 | std::stack<Frame> _frame_stack; | |
| 50 | std::stack<OdoFrame> _frame_stack; | |
| 51 | 51 | std::stack<HandleSeq> _odo_sections; |
| 52 | 52 | void push_frame(); |
| 53 | 53 | void pop_frame(); |
| … | … | @@ -41,12 +41,12 @@ static inline double uniform_double(void) |
| 41 | 41 | return dist(rangen); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | bool BasicParameters::connect_existing(const Frame& frm) | |
| 44 | bool BasicParameters::connect_existing(const OdoFrame& frm) | |
| 45 | 45 | { |
| 46 | 46 | return uniform_double() < close_fraction; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | bool BasicParameters::step(const Frame& frm) | |
| 49 | bool BasicParameters::step(const OdoFrame& frm) | |
| 50 | 50 | { |
| 51 | 51 | return true; |
| 52 | 52 | } |
| … | … | @@ -42,8 +42,8 @@ public: |
| 42 | 42 | BasicParameters(); |
| 43 | 43 | virtual ~BasicParameters(); |
| 44 | 44 | |
| 45 | virtual bool connect_existing(const Frame&); | |
| 46 | virtual bool step(const Frame&); | |
| 45 | virtual bool connect_existing(const OdoFrame&); | |
| 46 | virtual bool step(const OdoFrame&); | |
| 47 | 47 | |
| 48 | 48 | /// Fraction of the time that an attempt should be made to join |
| 49 | 49 | /// together two existing open connectors, if that is possible. |
| … | … | @@ -34,7 +34,7 @@ CollectStyle::~CollectStyle() {} |
| 34 | 34 | /// In this "style" of recording a result, we just tack it onto |
| 35 | 35 | /// a C++ container holding the solutions. Other "styles" are |
| 36 | 36 | /// possible; we could report them elsewehre, too... |
| 37 | void CollectStyle::record_solution(const Frame& frm) | |
| 37 | void CollectStyle::record_solution(const OdoFrame& frm) | |
| 38 | 38 | { |
| 39 | 39 | size_t nsolns = _solutions.size(); |
| 40 | 40 | _solutions.insert(frm._linkage); |
| … | … | @@ -22,7 +22,7 @@ |
| 22 | 22 | #ifndef _OPENCOG_COLLECT_STYLE_H |
| 23 | 23 | #define _OPENCOG_COLLECT_STYLE_H |
| 24 | 24 | |
| 25 | #include <opencog/generate/Frame.h> | |
| 25 | #include <opencog/generate/Odometer.h> | |
| 26 | 26 | |
| 27 | 27 | namespace opencog |
| 28 | 28 | { |
| … | … | @@ -44,7 +44,7 @@ public: |
| 44 | 44 | ~CollectStyle(); |
| 45 | 45 | |
| 46 | 46 | void clear(void) { _solutions.clear(); } |
| 47 | void record_solution(const Frame&); | |
| 47 | void record_solution(const OdoFrame&); | |
| 48 | 48 | |
| 49 | 49 | size_t num_solutions(void) { return _solutions.size(); } |
| 50 | 50 | std::set<HandleSet> get_solution_set(void) { return _solutions; } |
| … | … | @@ -23,7 +23,7 @@ |
| 23 | 23 | #define _OPENCOG_GENERATE_CALLBACK_H |
| 24 | 24 | |
| 25 | 25 | #include <opencog/atomspace/AtomSpace.h> |
| 26 | #include <opencog/generate/Frame.h> | |
| 26 | #include <opencog/generate/Odometer.h> | |
| 27 | 27 | |
| 28 | 28 | namespace opencog |
| 29 | 29 | { |
| … | … | @@ -91,7 +91,7 @@ public: |
| 91 | 91 | /// This should be implemented so that it behaves like a 'future' |
| 92 | 92 | /// or a 'promise', so that, when called, it returns the next |
| 93 | 93 | /// section from a (virtual) list of eligible sections. |
| 94 | virtual Handle select(const Frame&, | |
| 94 | virtual Handle select(const OdoFrame&, | |
| 95 | 95 | const Handle& fm_sect, size_t offset, |
| 96 | 96 | const Handle& to_con) = 0; |
| 97 | 97 | |
| … | … | @@ -108,8 +108,8 @@ public: |
| 108 | 108 | virtual size_t num_links(const Handle& fm_sect, const Handle& to_sect, |
| 109 | 109 | const Handle& link_type) = 0; |
| 110 | 110 | |
| 111 | virtual void push_frame(const Frame&) {} | |
| 112 | virtual void pop_frame(const Frame&) {} | |
| 111 | virtual void push_frame(const OdoFrame&) {} | |
| 112 | virtual void pop_frame(const OdoFrame&) {} | |
| 113 | 113 | |
| 114 | 114 | virtual void push_odometer(const Odometer&) {} |
| 115 | 115 | virtual void pop_odometer(const Odometer&) {} |
| … | … | @@ -120,11 +120,11 @@ public: |
| 120 | 120 | /// Traversal will resume at an earlier level. |
| 121 | 121 | /// |
| 122 | 122 | /// The default below allows infinite recursion. |
| 123 | virtual bool step(const Frame&) { return true; } | |
| 123 | virtual bool step(const OdoFrame&) { return true; } | |
| 124 | 124 | |
| 125 | 125 | /// Called when a solution is found. A solution is a linkage, |
| 126 | 126 | /// with no open connectors. |
| 127 | virtual void solution(const Frame&) = 0; | |
| 127 | virtual void solution(const OdoFrame&) = 0; | |
| 128 | 128 | |
| 129 | 129 | /// Return a SetLink with all of the solutions that were |
| 130 | 130 | /// reported via the above callback. Perform any other AtomSpace |
| … | … | @@ -119,7 +119,7 @@ HandleSet RandomCallback::next_root(void) |
| 119 | 119 | |
| 120 | 120 | /// Return a section containing `to_con`. |
| 121 | 121 | /// Pick a new section from the lexis. |
| 122 | Handle RandomCallback::select_from_lexis(const Frame& frame, | |
| 122 | Handle RandomCallback::select_from_lexis(const OdoFrame& frame, | |
| 123 | 123 | const Handle& fm_sect, size_t offset, |
| 124 | 124 | const Handle& to_con) |
| 125 | 125 | { |
| … | … | @@ -169,7 +169,7 @@ Handle RandomCallback::select_from_lexis(const Frame& frame, |
| 169 | 169 | // |
| 170 | 170 | // This just sets up a list of candidates; the actual picking is done |
| 171 | 171 | // by `do_select_one()`. |
| 172 | Handle RandomCallback::select_from_open(const Frame& frame, | |
| 172 | Handle RandomCallback::select_from_open(const OdoFrame& frame, | |
| 173 | 173 | const Handle& fm_sect, size_t offset, |
| 174 | 174 | const Handle& to_con) |
| 175 | 175 | { |
| … | … | @@ -258,7 +258,7 @@ Handle RandomCallback::select_from_open(const Frame& frame, |
| 258 | 258 | /// Return a section containing `to_con`. |
| 259 | 259 | /// First try to attach to an existing open section. |
| 260 | 260 | /// If that fails, then pick a new section from the lexis. |
| 261 | Handle RandomCallback::select(const Frame& frame, | |
| 261 | Handle RandomCallback::select(const OdoFrame& frame, | |
| 262 | 262 | const Handle& fm_sect, size_t offset, |
| 263 | 263 | const Handle& to_con) |
| 264 | 264 | { |
| … | … | @@ -293,19 +293,19 @@ size_t RandomCallback::num_links(const Handle& fm_sect, |
| 293 | 293 | return num_undirected_links(fm_sect, to_sect, link_type); |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | void RandomCallback::push_frame(const Frame& frm) | |
| 296 | void RandomCallback::push_frame(const OdoFrame& frm) | |
| 297 | 297 | { |
| 298 | 298 | _opensel_stack.push(_opensel); |
| 299 | 299 | _opensel._opensect.clear(); |
| 300 | 300 | _opensel._opendi.clear(); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | void RandomCallback::pop_frame(const Frame& frm) | |
| 303 | void RandomCallback::pop_frame(const OdoFrame& frm) | |
| 304 | 304 | { |
| 305 | 305 | _opensel = _opensel_stack.top(); _opensel_stack.pop(); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | bool RandomCallback::step(const Frame& frm) | |
| 308 | bool RandomCallback::step(const OdoFrame& frm) | |
| 309 | 309 | { |
| 310 | 310 | _steps_taken ++; |
| 311 | 311 | if (max_steps < _steps_taken) return false; |
| … | … | @@ -316,7 +316,7 @@ bool RandomCallback::step(const Frame& frm) |
| 316 | 316 | // return _parms->step(frm); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | void RandomCallback::solution(const Frame& frm) | |
| 319 | void RandomCallback::solution(const OdoFrame& frm) | |
| 320 | 320 | { |
| 321 | 321 | record_solution(frm); |
| 322 | 322 | } |
| … | … | @@ -57,7 +57,7 @@ private: |
| 57 | 57 | |
| 58 | 58 | // ------------------------------------------- |
| 59 | 59 | // Lexical selection |
| 60 | Handle select_from_lexis(const Frame&, | |
| 60 | Handle select_from_lexis(const OdoFrame&, | |
| 61 | 61 | const Handle&, size_t, |
| 62 | 62 | const Handle&); |
| 63 | 63 | |
| … | … | @@ -67,7 +67,7 @@ private: |
| 67 | 67 | std::map<Handle, std::discrete_distribution<size_t>> _distmap; |
| 68 | 68 | |
| 69 | 69 | // ------------------------------------------- |
| 70 | Handle select_from_open(const Frame&, | |
| 70 | Handle select_from_open(const OdoFrame&, | |
| 71 | 71 | const Handle&, size_t, |
| 72 | 72 | const Handle&); |
| 73 | 73 | struct OpenSelections |
| … | … | @@ -95,7 +95,7 @@ public: |
| 95 | 95 | virtual HandleSeq joints(const Handle& con) { |
| 96 | 96 | return _dict.joints(con); |
| 97 | 97 | } |
| 98 | virtual Handle select(const Frame&, | |
| 98 | virtual Handle select(const OdoFrame&, | |
| 99 | 99 | const Handle&, size_t, |
| 100 | 100 | const Handle&); |
| 101 | 101 | |
| … | … | @@ -103,11 +103,11 @@ public: |
| 103 | 103 | const Handle&, const Handle&); |
| 104 | 104 | virtual size_t num_links(const Handle&, const Handle&, |
| 105 | 105 | const Handle&); |
| 106 | virtual void push_frame(const Frame&); | |
| 107 | virtual void pop_frame(const Frame&); | |
| 106 | virtual void push_frame(const OdoFrame&); | |
| 107 | virtual void pop_frame(const OdoFrame&); | |
| 108 | 108 | |
| 109 | virtual bool step(const Frame&); | |
| 110 | virtual void solution(const Frame&); | |
| 109 | virtual bool step(const OdoFrame&); | |
| 110 | virtual void solution(const OdoFrame&); | |
| 111 | 111 | virtual Handle get_solutions(void); |
| 112 | 112 | }; |
| 113 | 113 |
| … | … | @@ -22,7 +22,7 @@ |
| 22 | 22 | #ifndef _OPENCOG_RANDOM_PARAMETERS_H |
| 23 | 23 | #define _OPENCOG_RANDOM_PARAMETERS_H |
| 24 | 24 | |
| 25 | #include <opencog/generate/Frame.h> | |
| 25 | #include <opencog/generate/Odometer.h> | |
| 26 | 26 | |
| 27 | 27 | namespace opencog |
| 28 | 28 | { |
| … | … | @@ -46,12 +46,12 @@ public: |
| 46 | 46 | /// the lexis. Consistently returning true will maximally close off |
| 47 | 47 | /// any open connectors without enlarging the network. Rturning false |
| 48 | 48 | /// will always increase the size of the network. |
| 49 | virtual bool connect_existing(const Frame&) = 0; | |
| 49 | virtual bool connect_existing(const OdoFrame&) = 0; | |
| 50 | 50 | |
| 51 | 51 | /// Return true to continue stepping the odometer. Called before |
| 52 | 52 | /// taking an odometer step. Returning false will abort the |
| 53 | 53 | /// current odometer. |
| 54 | virtual bool step(const Frame&) = 0; | |
| 54 | virtual bool step(const OdoFrame&) = 0; | |
| 55 | 55 | }; |
| 56 | 56 | |
| 57 | 57 |
| … | … | @@ -97,7 +97,7 @@ HandleSet SimpleCallback::next_root(void) |
| 97 | 97 | |
| 98 | 98 | /// Return a section containing `to_con`. |
| 99 | 99 | /// Pick a new section from the lexis. |
| 100 | Handle SimpleCallback::select_from_lexis(const Frame& frame, | |
| 100 | Handle SimpleCallback::select_from_lexis(const OdoFrame& frame, | |
| 101 | 101 | const Handle& fm_sect, size_t offset, |
| 102 | 102 | const Handle& to_con) |
| 103 | 103 | { |
| … | … | @@ -158,7 +158,7 @@ Handle SimpleCallback::check_self(const HandleSeq& to_sects, |
| 158 | 158 | |
| 159 | 159 | /// Return a section containing `to_con`. |
| 160 | 160 | /// Try to attach to an existing open section. |
| 161 | Handle SimpleCallback::select_from_open(const Frame& frame, | |
| 161 | Handle SimpleCallback::select_from_open(const OdoFrame& frame, | |
| 162 | 162 | const Handle& fm_sect, size_t offset, |
| 163 | 163 | const Handle& to_con) |
| 164 | 164 | { |
| … | … | @@ -204,7 +204,7 @@ Handle SimpleCallback::select_from_open(const Frame& frame, |
| 204 | 204 | /// Return a section containing `to_con`. |
| 205 | 205 | /// First try to attach to an existing open section. |
| 206 | 206 | /// If that fails, then pick a new section from the lexis. |
| 207 | Handle SimpleCallback::select(const Frame& frame, | |
| 207 | Handle SimpleCallback::select(const OdoFrame& frame, | |
| 208 | 208 | const Handle& fm_sect, size_t offset, |
| 209 | 209 | const Handle& to_con) |
| 210 | 210 | { |
| … | … | @@ -240,14 +240,14 @@ size_t SimpleCallback::num_links(const Handle& fm_sect, |
| 240 | 240 | return num_undirected_links(fm_sect, to_sect, link_type); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | void SimpleCallback::push_frame(const Frame& frm) | |
| 243 | void SimpleCallback::push_frame(const OdoFrame& frm) | |
| 244 | 244 | { |
| 245 | 245 | _opensel_stack.push(_opensel); |
| 246 | 246 | _opensel._opensect.clear(); |
| 247 | 247 | _opensel._openit.clear(); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | void SimpleCallback::pop_frame(const Frame& frm) | |
| 250 | void SimpleCallback::pop_frame(const OdoFrame& frm) | |
| 251 | 251 | { |
| 252 | 252 | _opensel = _opensel_stack.top(); _opensel_stack.pop(); |
| 253 | 253 | } |
| … | … | @@ -263,7 +263,7 @@ void SimpleCallback::pop_odometer(const Odometer& odo) |
| 263 | 263 | _lexlit = _lexlit_stack.top(); _lexlit_stack.pop(); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | bool SimpleCallback::step(const Frame& frm) | |
| 266 | bool SimpleCallback::step(const OdoFrame& frm) | |
| 267 | 267 | { |
| 268 | 268 | _steps_taken ++; |
| 269 | 269 | if (max_steps < _steps_taken) return false; |
| … | … | @@ -273,7 +273,7 @@ bool SimpleCallback::step(const Frame& frm) |
| 273 | 273 | return true; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | void SimpleCallback::solution(const Frame& frm) | |
| 276 | void SimpleCallback::solution(const OdoFrame& frm) | |
| 277 | 277 | { |
| 278 | 278 | record_solution(frm); |
| 279 | 279 | } |
| … | … | @@ -61,7 +61,7 @@ private: |
| 61 | 61 | |
| 62 | 62 | // ------------------------------------------- |
| 63 | 63 | // Lexical selection |
| 64 | Handle select_from_lexis(const Frame&, | |
| 64 | Handle select_from_lexis(const OdoFrame&, | |
| 65 | 65 | const Handle&, size_t, |
| 66 | 66 | const Handle&); |
| 67 | 67 | |
| … | … | @@ -74,7 +74,7 @@ private: |
| 74 | 74 | std::stack<HandleUCounter> _lexlit_stack; |
| 75 | 75 | |
| 76 | 76 | // ------------------------------------------- |
| 77 | Handle select_from_open(const Frame&, | |
| 77 | Handle select_from_open(const OdoFrame&, | |
| 78 | 78 | const Handle&, size_t, |
| 79 | 79 | const Handle&); |
| 80 | 80 | Handle check_self(const HandleSeq&, const Handle&, |
| … | … | @@ -97,7 +97,7 @@ public: |
| 97 | 97 | virtual ~SimpleCallback(); |
| 98 | 98 | |
| 99 | 99 | virtual void clear(AtomSpace*); |
| 100 | virtual bool step(const Frame&); | |
| 100 | virtual bool step(const OdoFrame&); | |
| 101 | 101 | virtual HandleSeq joints(const Handle& con) { |
| 102 | 102 | return _dict.joints(con); |
| 103 | 103 | } |
| … | … | @@ -105,7 +105,7 @@ public: |
| 105 | 105 | virtual void root_set(const HandleSet&); |
| 106 | 106 | virtual HandleSet next_root(void); |
| 107 | 107 | |
| 108 | virtual Handle select(const Frame&, | |
| 108 | virtual Handle select(const OdoFrame&, | |
| 109 | 109 | const Handle&, size_t, |
| 110 | 110 | const Handle&); |
| 111 | 111 | |
| … | … | @@ -113,11 +113,11 @@ public: |
| 113 | 113 | const Handle&, const Handle&); |
| 114 | 114 | virtual size_t num_links(const Handle&, const Handle&, |
| 115 | 115 | const Handle&); |
| 116 | virtual void push_frame(const Frame&); | |
| 117 | virtual void pop_frame(const Frame&); | |
| 116 | virtual void push_frame(const OdoFrame&); | |
| 117 | virtual void pop_frame(const OdoFrame&); | |
| 118 | 118 | virtual void push_odometer(const Odometer&); |
| 119 | 119 | virtual void pop_odometer(const Odometer&); |
| 120 | virtual void solution(const Frame&); | |
| 120 | virtual void solution(const OdoFrame&); | |
| 121 | 121 | virtual Handle get_solutions(void); |
| 122 | 122 | }; |
| 123 | 123 |