<commit_before>
// License: see LICENSE.txt

#ifndef NetworkTesterHeader
#define NetworkTesterHeader

#include <BioActors/Actor.h>

class NetworkTester : public Actor{

	Message dummyMessage;

	enum {
		BOOT, // needed to offset values by 1
		SAY_HELLO,
		DIE
	};
public:

	NetworkTester() {

	}

	void Receive(Message & message) {
		int tag = message.GetTag();

		switch(tag) {

			case Actor::BOOT: {
				Boot();
			}
			break;

			case SAY_HELLO: {
				SayHello();
			}
			break;

			case DIE: {

				cout << "[" << GetAddress() << "] ";
				cout << " Now I die." << endl;
				Die();
			}
			break;
		}
	}

	void SayHello() {
		cout << "[" << GetAddress() << "] ";
		cout << "Hello ! I am " << GetAddress() << endl;

		dummyMessage.SetTag(DIE);

		int address = GetAddress();

		// kill the actor
		Send(address, dummyMessage);

	}

	void Boot() {
		cout << "[" << GetAddress() << "] ";
		cout << "I am booting now ( " << GetAddress() << ") ";
		cout << " actors " << GetSize() << endl;

		int address = GetAddress();

		cout << "[" << GetAddress() << "] ";
		cout << "Sending message to " << address << endl;

		dummyMessage.SetTag(SAY_HELLO);

		Send(address, dummyMessage);

	}
};

#endif
<commit_msg>move messages inside handlers<commit_after>
// License: see LICENSE.txt

#ifndef NetworkTesterHeader
#define NetworkTesterHeader

#include <BioActors/Actor.h>

class NetworkTester : public Actor{

	enum {
		BOOT, // needed to offset values by 1
		SAY_HELLO,
		DIE
	};
public:

	NetworkTester() {

	}

	void Receive(Message & message) {
		int tag = message.GetTag();

		switch(tag) {

			case Actor::BOOT: {
				Boot();
			}
			break;

			case SAY_HELLO: {
				SayHello();
			}
			break;

			case DIE: {

				cout << "[" << GetAddress() << "] ";
				cout << " Now I die." << endl;
				Die();
			}
			break;
		}
	}

	void SayHello() {
		cout << "[" << GetAddress() << "] ";
		cout << "Hello ! I am " << GetAddress() << endl;

		Message dummyMessage;
		dummyMessage.SetTag(DIE);

		int address = GetAddress();

		// kill the actor
		Send(address, dummyMessage);

	}

	void Boot() {
		cout << "[" << GetAddress() << "] ";
		cout << "I am booting now ( " << GetAddress() << ") ";
		cout << " actors " << GetSize() << endl;

		int address = GetAddress();

		cout << "[" << GetAddress() << "] ";
		cout << "Sending message to " << address << endl;

		Message dummyMessage;
		dummyMessage.SetTag(SAY_HELLO);

		Send(address, dummyMessage);

	}
};

#endif

{'fraction_non_alphanumeric': 0.1780766096169519, 'fraction_numerical': 0.0008149959250203749, 'mean_word_length': 2.8722397476340693, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4404245', 'n_tokens_mistral': 1020, 'n_tokens_neox': 859, 'n_words': 209}