Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions config/client.json

This file was deleted.

69 changes: 58 additions & 11 deletions config/das.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"schema_version": "1.0",
"atomdb": {
"type": "redismongodb",
"redis": {
Expand Down Expand Up @@ -122,30 +121,78 @@
}
},
"agents": {
"schema_version": "1.0",
"attention": {
"endpoint": "localhost:40001"
},
"base_query": {
"params": {
"unique_assignment_flag": false,
"attention_update": 0,
"attention_correlation": 0,
"max_bundle_size": 1000,
"max_answers": 0,
"use_link_template_cache": false,
"populate_metta_mapping": false,
"use_metta_as_query_tokens": false,
"allow_incomplete_chain_path": false
}
},
"query": {
"endpoint": "localhost:40002",
"ports_range": "42000:42999"
"ports_range": "42000:42999",
"params": {
"positive_importance_flag": false,
"disregard_importance_flag": false,
"unique_value_flag": false,
"count_flag": false
}
},
"link_creation": {
"endpoint": "localhost:40003",
"ports_range": "43000:43999"
"ports_range": "43000:43999",
"params": {
"max_answers": 10,
"repeat_count": 1,
"context": "context",
"attention_update": 0,
"attention_correlation": 0,
"positive_importance_flag": true,
"query_interval": 0,
"query_timeout": 0,
"use_metta_as_query_tokens": false
}
},
"inference": {
"endpoint": "localhost:40004",
"ports_range": "44000:44999"
"ports_range": "44000:44999",
"params": {
"inference_request_timeout": 86400,
"repeat_count": 5,
"max_answers": 150
}
},
"evolution": {
"endpoint": "localhost:40005",
"ports_range": "45000:45999"
}
},
"brokers": {
"attention": {
"endpoint": "localhost:40001"
"ports_range": "45000:45999",
"params": {
"population_size": 1000,
"max_generations": 100,
"elitism_rate": 0.01,
"selection_rate": 0.1
}
},
"context": {
"endpoint": "localhost:40006",
"ports_range": "46000:46999"
"ports_range": "46000:46999",
"params": {
"context": "context",
"use_cache": true,
"enforce_cache_recreation": false,
"initial_rent_rate": 0.75,
"initial_spreading_rate_lowerbound": 0.1,
"initial_spreading_rate_upperbound": 0.1
}
},
"atomdb": {
"endpoint": "localhost:40007",
Expand Down
11 changes: 2 additions & 9 deletions src/agents/BaseQueryProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Logger.h"
#include "ServiceBus.h"
#include "SystemParametersSingleton.h"

using namespace agents;

Expand Down Expand Up @@ -39,15 +40,7 @@ BaseQueryProxy::BaseQueryProxy(const vector<string>& tokens, const string& conte
void BaseQueryProxy::init() {
this->atomdb = AtomDBSingleton::get_instance();
this->answer_count = 0;
this->parameters[UNIQUE_ASSIGNMENT_FLAG] = false;
this->parameters[ATTENTION_UPDATE] = (unsigned int) NONE;
this->parameters[ATTENTION_CORRELATION] = (unsigned int) NONE;
this->parameters[MAX_BUNDLE_SIZE] = (unsigned int) 1000;
this->parameters[MAX_ANSWERS] = (unsigned int) 0; // No limit
this->parameters[USE_LINK_TEMPLATE_CACHE] = false;
this->parameters[POPULATE_METTA_MAPPING] = false;
this->parameters[USE_METTA_AS_QUERY_TOKENS] = false;
this->parameters[ALLOW_INCOMPLETE_CHAIN_PATH] = false;
this->parameters = SystemParametersSingleton::get_instance()->get_base_query_params();
}

BaseQueryProxy::~BaseQueryProxy() {}
Expand Down
16 changes: 2 additions & 14 deletions src/agents/context_broker/ContextBrokerProxy.cc
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#include "ContextBrokerProxy.h"

#include "AtomDBSingleton.h"
#include "AttentionBrokerServer.h"
#include "Hasher.h"
#include "RedisMongoDB.h"
#include "ServiceBus.h"
#include "ServiceBusSingleton.h"
#include "SystemParametersSingleton.h"

#define LOG_LEVEL INFO_LEVEL
#include "Logger.h"

using namespace context_broker;
using namespace atomdb;
using namespace attention_broker;
using namespace query_engine;
using namespace service_bus;
using namespace commons;
Expand All @@ -36,13 +35,6 @@ string ContextBrokerProxy::INITIAL_RENT_RATE = "initial_rent_rate";
string ContextBrokerProxy::INITIAL_SPREADING_RATE_LOWERBOUND = "initial_spreading_rate_lowerbound";
string ContextBrokerProxy::INITIAL_SPREADING_RATE_UPPERBOUND = "initial_spreading_rate_upperbound";

// Default values for AttentionBrokerClient::set_parameters()
double ContextBrokerProxy::DEFAULT_RENT_RATE = AttentionBrokerServer::RENT_RATE;
double ContextBrokerProxy::DEFAULT_SPREADING_RATE_LOWERBOUND =
AttentionBrokerServer::SPREADING_RATE_LOWERBOUND;
double ContextBrokerProxy::DEFAULT_SPREADING_RATE_UPPERBOUND =
AttentionBrokerServer::SPREADING_RATE_UPPERBOUND;

// -------------------------------------------------------------------------------------------------
// Constructors, destructors and initialization

Expand Down Expand Up @@ -196,11 +188,7 @@ void ContextBrokerProxy::init(const string& name) {
}

void ContextBrokerProxy::set_default_query_parameters() {
this->parameters[USE_CACHE] = (bool) true;
this->parameters[ENFORCE_CACHE_RECREATION] = (bool) false;
this->parameters[INITIAL_RENT_RATE] = (double) DEFAULT_RENT_RATE;
this->parameters[INITIAL_SPREADING_RATE_LOWERBOUND] = (double) DEFAULT_SPREADING_RATE_LOWERBOUND;
this->parameters[INITIAL_SPREADING_RATE_UPPERBOUND] = (double) DEFAULT_SPREADING_RATE_UPPERBOUND;
this->parameters = SystemParametersSingleton::get_instance()->get_context_agent_params();
}

// ---------------------------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions src/agents/evolution/QueryEvolutionProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "FitnessFunctionRegistry.h"
#include "ServiceBus.h"
#include "SystemParametersSingleton.h"

#define LOG_LEVEL INFO_LEVEL
#include "Logger.h"
Expand Down Expand Up @@ -55,10 +56,7 @@ void QueryEvolutionProxy::init() {
}

void QueryEvolutionProxy::set_default_query_parameters() {
this->parameters[POPULATION_SIZE] = (unsigned int) 1000;
this->parameters[MAX_GENERATIONS] = (unsigned int) 100;
this->parameters[ELITISM_RATE] = (double) 0.01;
this->parameters[SELECTION_RATE] = (double) 0.1;
this->parameters = SystemParametersSingleton::get_instance()->get_evolution_agent_params();
}

string QueryEvolutionProxy::to_string() {
Expand Down
8 changes: 2 additions & 6 deletions src/agents/inference_agent/InferenceProxy.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "InferenceProxy.h"

#include "ServiceBus.h"
#include "SystemParametersSingleton.h"

using namespace inference_agent;

Expand All @@ -21,12 +22,7 @@ InferenceProxy::~InferenceProxy() {}
void InferenceProxy::pack_command_line_args() { tokenize(this->args); }

void InferenceProxy::set_default_parameters() {
this->parameters[INFERENCE_REQUEST_TIMEOUT] =
(unsigned int) 24 * 60 * 60; // Default timeout is 24 hours
this->parameters[ATTENTION_CORRELATION] = (unsigned int) BaseQueryProxy::NONE;
this->parameters[ATTENTION_UPDATE] = (unsigned int) BaseQueryProxy::NONE;
this->parameters[REPEAT_COUNT] = (unsigned int) 5;
this->parameters[MAX_ANSWERS] = (unsigned int) 150;
this->parameters = SystemParametersSingleton::get_instance()->get_inference_agent_params();
}

void InferenceProxy::set_parameter(const string& key, const PropertyValue& value) {
Expand Down
12 changes: 2 additions & 10 deletions src/agents/link_creation_agent/LinkCreationRequestProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "BaseQueryProxy.h"
#include "ServiceBus.h"
#include "SystemParametersSingleton.h"

using namespace link_creation_agent;

Expand Down Expand Up @@ -29,16 +30,7 @@ LinkCreationRequestProxy::~LinkCreationRequestProxy() {}
void LinkCreationRequestProxy::pack_command_line_args() { tokenize(this->args); }

void LinkCreationRequestProxy::set_default_parameters() {
this->parameters[LinkCreationRequestProxy::MAX_ANSWERS] = (unsigned int) 10;
this->parameters[LinkCreationRequestProxy::REPEAT_COUNT] = (unsigned int) 1;
this->parameters[LinkCreationRequestProxy::CONTEXT] = string("");
this->parameters[LinkCreationRequestProxy::ATTENTION_UPDATE] = (unsigned int) BaseQueryProxy::NONE;
this->parameters[LinkCreationRequestProxy::ATTENTION_CORRELATION] =
(unsigned int) BaseQueryProxy::NONE;
this->parameters[LinkCreationRequestProxy::POSITIVE_IMPORTANCE_FLAG] = true;
this->parameters[LinkCreationRequestProxy::QUERY_INTERVAL] = (unsigned int) 0;
this->parameters[LinkCreationRequestProxy::QUERY_TIMEOUT] = (unsigned int) 0;
this->parameters[LinkCreationRequestProxy::USE_METTA_AS_QUERY_TOKENS] = false;
this->parameters = SystemParametersSingleton::get_instance()->get_link_creation_agent_params();
}

void LinkCreationRequestProxy::set_parameter(const string& key, const PropertyValue& value) {
Expand Down
6 changes: 2 additions & 4 deletions src/agents/query_engine/PatternMatchingQueryProxy.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "PatternMatchingQueryProxy.h"

#include "ServiceBus.h"
#include "SystemParametersSingleton.h"

#define LOG_LEVEL INFO_LEVEL
#include "Logger.h"
Expand Down Expand Up @@ -32,10 +33,7 @@ PatternMatchingQueryProxy::PatternMatchingQueryProxy(const vector<string>& token
}

void PatternMatchingQueryProxy::set_default_parameters() {
this->parameters[POSITIVE_IMPORTANCE_FLAG] = false;
this->parameters[DISREGARD_IMPORTANCE_FLAG] = false;
this->parameters[UNIQUE_VALUE_FLAG] = false;
this->parameters[COUNT_FLAG] = false;
this->parameters = SystemParametersSingleton::get_instance()->get_query_agent_params();
}

PatternMatchingQueryProxy::~PatternMatchingQueryProxy() {}
Expand Down
Loading
Loading