<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ActorTestingFramework
{
    public class RandomScheduler : IScheduler
    {
        private readonly Random rand;

        public RandomScheduler(int seed)
        {
            rand = new Random(seed);
        }

        private static bool IsProgressOp(OpType op)
        {
            switch (op)
            {
                case OpType.INVALID:
                case OpType.START:
                case OpType.END:
                case OpType.CREATE:
                case OpType.JOIN:
                case OpType.WaitForDeadlock:
                case OpType.Yield:
                    return false;
                case OpType.SEND:
                case OpType.RECEIVE:
                    return true;
                default:
                    throw new ArgumentOutOfRangeException(nameof(op), op, null);
            }
        }

        #region Implementation of IScheduler

        public ActorInfo GetNext(List<ActorInfo> actorList, ActorInfo currentActor)
        {
            if (currentActor.currentOp == OpType.Yield)
            {
                currentActor.enabled = false;
            }
<commit_msg>Change how yield works: treat more op types as "progress".<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ActorTestingFramework
{
    public class RandomScheduler : IScheduler
    {
        private readonly Random rand;

        public RandomScheduler(int seed)
        {
            rand = new Random(seed);
        }

        private static bool IsProgressOp(OpType op)
        {
            switch (op)
            {
                case OpType.INVALID:
                case OpType.WaitForDeadlock:
                case OpType.Yield:
                    return false;
                case OpType.START:
                case OpType.END:
                case OpType.CREATE:
                case OpType.JOIN:
                case OpType.SEND:
                case OpType.RECEIVE:
                    return true;
                default:
                    throw new ArgumentOutOfRangeException(nameof(op), op, null);
            }
        }

        #region Implementation of IScheduler

        public ActorInfo GetNext(List<ActorInfo> actorList, ActorInfo currentActor)
        {
            if (currentActor.currentOp == OpType.Yield)
            {
                currentActor.enabled = false;
            }

{'fraction_non_alphanumeric': 0.06308127780024263, 'fraction_numerical': 0.0, 'mean_word_length': 1.3765609990393852, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5311514', 'n_tokens_mistral': 631, 'n_tokens_neox': 592, 'n_words': 153}