<commit_before>package main

import (
	"github.com/bgmerrell/simulago"
	"github.com/bgmerrell/simulago/pcomm"
)

// simpy example:
/*
import simpy

def example(env):
    for i in range(2):
        event = simpy.events.Timeout(env, delay=1, value=42)
        value = yield event
        print('now=%d, value=%d' % (env.now, value))

env = simpy.Environment()
example_gen = example(env)
_ = simpy.events.Process(env, example_gen)

env.step()
env.step()
env.step()
*/

// Output:
/*
now=1, value=42
now=2, value=42
*/

func example(env *simulago.Environment, pc *pcomm.PCommunicator) {
	for i := 0; i < 2; i++ {
		to := simulago.NewTimeout(env, 10)
		to.Schedule(env)
		pc.Send(to.Event)
	}
}

func main() {
	env := simulago.NewEnvironment()
	pc := simulago.ProcWrapper(env, example)
	p := simulago.NewProcess(env, pc)
	p.Init()
	env.Step()
	env.Step()
	env.Step()
}<commit_msg>Minor cleanup of timeout example<commit_after>package main

import (
	"github.com/bgmerrell/simulago"
	"github.com/bgmerrell/simulago/pcomm"
)

// simpy example:
/*
import simpy

def example(env):
    for i in range(2):
        event = simpy.events.Timeout(env, delay=1, value=42)
        value = yield event
        print('now=%d, value=%d' % (env.now, value))

env = simpy.Environment()
example_gen = example(env)
_ = simpy.events.Process(env, example_gen)

env.step()
env.step()
env.step()
*/

// Output:
/*
now=1, value=42
now=2, value=42
*/

func example(env *simulago.Environment, pc *pcomm.PCommunicator) {
	for i := 0; i < 2; i++ {
		to := simulago.NewTimeout(env, 10)
		to.Schedule(env)
		pc.Send(to.Event)
	}
}

func main() {
	env := simulago.NewEnvironment()
	p := simulago.NewProcess(env, simulago.ProcWrapper(env, example))
	p.Init()
	env.Step()
	env.Step()
	env.Step()
}
{'fraction_non_alphanumeric': 0.1716884593519045, 'fraction_numerical': 0.015918135304150087, 'mean_word_length': 3.7184986595174263, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6157868', 'n_tokens_mistral': 722, 'n_tokens_neox': 698, 'n_words': 142}