73 c->
i = 51.6407 * (M_PI/180.0);
74 c->
O = 126.7653 * (M_PI/180.0);
75 c->
w = 163.1572 * (M_PI/180.0);
79 c->
n = pow( (c->
mu / pow(c->
a,3.0) ), (0.5) );
81 c->
T = ( 2.0 * M_PI ) / c->
n;
83 string request =
"are_you_out_there";
85 string workernames[3] = {
"albeert",
"elizabeth",
"corbee"};
94 int workernum = rand() % (
sizeof(workernames)/
sizeof(*workernames));
95 string worker =
"worker_0" +
to_string(workernum+1);
100 if(response.size()) {
101 string s =
"\t[" + worker +
":" + workernames[workernum] +
"]";
102 cout<<left<<setw(40)<< s <<setw(16)<<
"\033[1;32mFOUND\033[0m"<<endl;
107 cout<<response<<endl;
111 string s =
"\t[" + worker +
":" + workernames[workernum] +
"]";
112 cout<<left<<setw(40) << s <<
"\033[1;31mNOT FOUND\033[0m"<<endl;
int32_t are_you_out_there(string &request, string &response, Agent *cdata)
Definition: worker_02.cpp:123
string node_agent_name
Definition: worker_02.cpp:46
int32_t send_request(beatstruc cbeat, string request, string &output, float waitsec=5.)
Send a request over AGENT.
Definition: agentclass.cpp:424
string to_string(char *value)
Definition: stringlib.cpp:220
bool once
Definition: worker_02.cpp:48
string agent_name
Definition: worker_02.cpp:45
double O
Definition: jsondef.h:4336
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: worker_02.cpp:43
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
string node_name
Definition: worker_02.cpp:44
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
Definition: agentclass.h:139
int32_t req_pass_message(string &request, string &response, Agent *)
Definition: worker_02.cpp:131
double mu
Definition: jsondef.h:4350
int32_t last_error()
Definition: agentclass.cpp:414
double T
Definition: jsondef.h:4356
double w
Definition: jsondef.h:4338
beatstruc find_agent(string node, string agent, double waitsec=0.)
Find agent.
Definition: agentclass.cpp:559
string tel_message
Definition: worker_02.cpp:49
cosmosstruc * cinfo
Definition: agentclass.h:346
double n
Definition: jsondef.h:4353
Definition: jsondef.h:4199
double a
Definition: jsondef.h:4320
double tau
Definition: jsondef.h:4340
double i
Definition: jsondef.h:4334
double e
Definition: jsondef.h:4322