<commit_before>/*
 * The MIT License (MIT)
 * 
 * Copyright (c) 2013 by <NAME>
 * You can contact me by e-mail at: adam /at\ kurkiewicz /dot\ pl
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software. 
 */

import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;


abstract class GraphExplorator implements Runnable{
	static public Thread mainThread;
    static protected AtomicInteger counter = new AtomicInteger(1);
    static protected ExecutorService executor;
    static public long startTime;
    static public long stopTime;
    final protected Node start;
    final protected DataGraph dg;

    protected GraphExplorator(Node start, DataGraph dg){
        this.start = start;
        this.dg = dg;
    }
    
    public void startWithTimer(){
    	startTime = System.currentTimeMillis();
    	executor.execute(this);
    }
    
    public GraphExplorator(ExecutorService executor, Node start, DataGraph dg){
        this(start, dg);
        GraphExplorator.executor = executor;
    }
    
    protected void whenFinished(){
    	stopTime = System.currentTimeMillis();
        counter.set(1);
    	//executor.shutdown();
        mainThread.interrupt();
    }
    @Override
    abstract public void run();
    
}<commit_msg>gc before testcases<commit_after>/*
 * The MIT License (MIT)
 * 
 * Copyright (c) 2013 by <NAME>
 * You can contact me by e-mail at: adam /at\ kurkiewicz /dot\ pl
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software. 
 */

import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;


abstract class GraphExplorator implements Runnable{
	static public Thread mainThread;
    static protected AtomicInteger counter = new AtomicInteger(1);
    static protected ExecutorService executor;
    static public long startTime;
    static public long stopTime;
    final protected Node start;
    final protected DataGraph dg;

    protected GraphExplorator(Node start, DataGraph dg){
        this.start = start;
        this.dg = dg;
    }
    
    public void startWithTimer(){
    	System.gc();
    	startTime = System.currentTimeMillis();
    	executor.execute(this);
    }
    
    public void startExploration(){
    	executor.execute(this);
    }
    
    public GraphExplorator(ExecutorService executor, Node start, DataGraph dg){
        this(start, dg);
        GraphExplorator.executor = executor;
    }
    
    protected void whenFinished(){
    	//uncomment this to carry out the measurement
    	stopTime = System.currentTimeMillis();
        counter.set(1);
    	//executor.shutdown();
        mainThread.interrupt();
    }
    @Override
    abstract public void run();
    
}
{'fraction_non_alphanumeric': 0.07710715235309758, 'fraction_numerical': 0.0031906407870247273, 'mean_word_length': 3.2945205479452055, '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': '4087344', 'n_tokens_mistral': 1031, 'n_tokens_neox': 982, 'n_words': 386}