size_t parse1::insert(const string & str){ string t_str = remove_white( remove_comments(str)); if (isLabel(t_str)) { makeSymbol(t_str); return linked_list.size(); }else if(is_at(t_str)){ makeSplit(t_str); return linked_list.size(); } if (t_str == "") { return linked_list.size();} else {linked_list.push_back(t_str);} return linked_list.size(); }
bool nevil::test_robot::update(const nevil::object_list &objects) { // Increase robot's fitness if it's under the light if (is_at(objects.at("light"), ON)) _individual->increase_fitness(1); // Get the sensor information auto inputs = _get_camera_inputs(objects); // Add the bias input inputs[_input_num - 1] = 1; // Evaluate the neural network auto output = _neural_network.update(inputs); // Pass the output of each NN and convert it to motor velocities _set_wheels_speed(output[0], output[1]); return true; }
const twidget* twidget::find_at(const tpoint& coordinate, const bool must_be_active) const { return is_at(coordinate, must_be_active) ? this : NULL; }
/** (Will be) inherited from event::tdispatcher. */ virtual bool is_at(const tpoint& coordinate) const { return is_at(coordinate, true); }
bool widget::is_at(const point& coordinate) const { return is_at(coordinate, true); }
const widget* widget::find_at(const point& coordinate, const bool must_be_active) const { return is_at(coordinate, must_be_active) ? this : nullptr; }