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] = {
"elizabeth",
"beeber",
"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;
string tel_message
Definition: worker_01.cpp:49
string agent_name
Definition: worker_01.cpp:45
int32_t send_request(beatstruc cbeat, string request, string &output, float waitsec=5.)
Send a request over AGENT.
Definition: agentclass.cpp:424
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: worker_01.cpp:43
string to_string(char *value)
Definition: stringlib.cpp:220
string node_agent_name
Definition: worker_01.cpp:46
double O
Definition: jsondef.h:4336
string node_name
Definition: worker_01.cpp:44
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
int32_t are_you_out_there(string &request, string &response, Agent *cdata)
Definition: worker_01.cpp:123
bool once
Definition: worker_01.cpp:48
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
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
int32_t req_pass_message(string &request, string &response, Agent *)
Definition: worker_01.cpp:131
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