<commit_before>var Scheduler  = require('./src/scheduler');

var req0 =
{
  process: 'A',
  pageNumber: 1,
  mode: "read"
};

var req1 =
{
  process: 'A',
  pageNumber: 2,
  mode: "read"
};

var req2 =
{
  process: 'B',
  pageNumber: 2,
  mode: "read"
};

var req3 =
{
  process: 'A',
  pageNumber: 3,
  mode: "read"
};

var req4 =
{
  process: 'C',
  pageNumber: 1,
  mode: "read"
};

var reqs = [req0, req1, req2, req0, req3, req4, req4];

var sams = new Scheduler();
sams.setAlgorithm("fifo");
sams.setMemorySize(3);
sams.addRequirements(reqs);
var instants = sams.run();
console.log(instants);
<commit_msg>Changed demo to show the last changes.<commit_after>var Scheduler  = require('./src/scheduler');

var req0 =
{
  process: 'A',
  pageNumber: 1,
  mode: "read"
};

var req0M =
{
  process: 'A',
  pageNumber: 1,
  mode: "write"
};

var req1 =
{
  process: 'A',
  pageNumber: 2,
  mode: "read"
};

var req2 =
{
  process: 'B',
  pageNumber: 2,
  mode: "read"
};

var req3 =
{
  process: 'A',
  pageNumber: 3,
  mode: "read"
};

var req4 =
{
  process: 'C',
  pageNumber: 1,
  mode: "read"
};

var reqs = [req0, req0M, req1, req2, req0, req3, req4];

var sams = new Scheduler();
sams.setAlgorithm("lru");
sams.setSecondChanceReplacementPolicy(true);
sams.setAsyncFlushReplacementPolicy(true);
sams.setMemorySize(3);
sams.addRequirements(reqs);
var instants = sams.run();
instants.forEach(function(moment, index) {
  console.log("Moment: " + index);
  console.log(moment);
});

{'fraction_non_alphanumeric': 0.18016194331983806, 'fraction_numerical': 0.02564102564102564, 'mean_word_length': 3.9433333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2151312', 'n_tokens_mistral': 633, 'n_tokens_neox': 621, 'n_words': 146}