<commit_before>import java.util.Random;
import java.text.DecimalFormat;

public class Vevent implements Comparable<Vevent>
{
	/*
		----TEMPLATE----
		https://en.wikipedia.org/wiki/ICalendar

		BEGIN:VEVENT
		UID:<EMAIL>
		DTSTAMP:19970714T170000Z
		ORGANIZER;CN=<NAME>:MAILTO:<EMAIL>
		DTSTART:19970714T170000Z
		DTEND:19970715T035959Z
		SUMMARY:Bastille Day Party
	*/

	private String UID;
	private String DTSTAMP;
	private String ORGANIZER;
	private String DTSTART;
	private String DTEND;
	private String SUMMARY;
	private Geo    GEO;
	private String CLASS;
	private String COMMENT;

	//default constructor
	public Vevent()
	{

	}

	//overloaded constructor
	public Vevent(String inputUID, String inputDTSTAMP, String inputORGANIZER, String inputDTSTART, String inputDTEND, String inputSUMMARY, Geo inputGEO, String inputCLASS)
	{
		UID       = inputUID;
		DTSTAMP   = inputDTSTAMP;
		ORGANIZER = inputORGANIZER;
		DTSTART   = inputDTSTART;
		DTEND     = inputDTEND;
		SUMMARY   = inputSUMMARY;
		GEO       = inputGEO;
		CLASS     = inputCLASS;
	}

	//sets all vevents members variables to random but valid values
	public void setRandomValues()
	{
		int minuidsize = 7;
		int maxuidsize = 20;
		int minsumsize = 10;
		int maxsumsize = 40;
		int minorgsize = 5;
		int maxorgsize = 20;

		String [] classOptions = {"PUBLIC", "PRIVATE"};
		DecimalFormat df = new DecimalFormat("#.##");

		int sizeOfUid       = minuidsize   + (int)(Math.random() * maxuidsize);
		int sizeOfSummary   = minsumsize   + (int)(Math.random() * maxsumsize);
		int sizeOfOrganizer = minorgsize   + (int)(Math.random() * maxorgsize);
		int classChoice     = 0            + (int)(Math.random() * 2         );
		double latChoice    = -90.0        + (Math.random()      * 90.0      );
		double lonChoice    = -180.0       + (Math.random()      * 180.0     );

		RandomString myRS1 = new RandomString(sizeOfUid);
		RandomString myRS2 = new RandomString(sizeOfSummary);
		RandomString myRS3 = new RandomString(sizeOfOrganizer);

		UID       = myRS1.nextString();
		SUMMARY   = myRS2.nextString();
		ORGANIZER = myRS3.nextString();
		CLASS     = classOptions[classChoice];
		GEO       = new Geo(df.format(latChoice) + ";" + df.format(lonChoice));
		DTSTAMP   = getRandomDate();
		DTSTART   = getRandomDate();
		DTEND     = getRandomDate();

		while(dateIsGreaterThanDate(DTSTAMP, DTSTART))
		{
			DTSTART = getRandomDate();
		}

		while(dateIsGreaterThanDate(DTSTART, DTEND))
		{
			DTEND = getRandomDate();
		}

		//DEBUG OUTPUT
		/*
		System.out.println("UID:       " + UID);
		System.out.println("SUMMARY:   " + SUMMARY);
		System.out.println("ORGANIZER: " + ORGANIZER);
		System.out.println("CLASS:     " + CLASS);
		System.out.println("GEO:       " + GEO.toString());
		System.out.println("DTSTAMP:   " + DTSTAMP);
		System.out.println("DTSTART:   " + DTSTART);
		System.out.println("DTEND      " + DTEND);
		*/
	}

	private String getRandomDate()<commit_msg>add comment randomization to random event<commit_after>import java.util.Random;
import java.text.DecimalFormat;

public class Vevent implements Comparable<Vevent>
{
	/*
		----TEMPLATE----
		https://en.wikipedia.org/wiki/ICalendar

		BEGIN:VEVENT
		UID:<EMAIL>
		DTSTAMP:19970714T170000Z
		ORGANIZER;CN=<NAME>:MAILTO:<EMAIL>
		DTSTART:19970714T170000Z
		DTEND:19970715T035959Z
		SUMMARY:Bastille Day Party
	*/

	private String UID;
	private String DTSTAMP;
	private String ORGANIZER;
	private String DTSTART;
	private String DTEND;
	private String SUMMARY;
	private Geo    GEO;
	private String CLASS;
	private String COMMENT;

	//default constructor
	public Vevent()
	{

	}

	//overloaded constructor
	public Vevent(String inputUID, String inputDTSTAMP, String inputORGANIZER, String inputDTSTART, String inputDTEND, String inputSUMMARY, Geo inputGEO, String inputCLASS)
	{
		UID       = inputUID;
		DTSTAMP   = inputDTSTAMP;
		ORGANIZER = inputORGANIZER;
		DTSTART   = inputDTSTART;
		DTEND     = inputDTEND;
		SUMMARY   = inputSUMMARY;
		GEO       = inputGEO;
		CLASS     = inputCLASS;
	}

	//sets all vevents members variables to random but valid values
	public void setRandomValues()
	{
		int minuidsize = 7;
		int maxuidsize = 20;
		int minsumsize = 10;
		int maxsumsize = 40;
		int minorgsize = 5;
		int maxorgsize = 20;

		String [] classOptions = {"PUBLIC", "PRIVATE"};
		DecimalFormat df = new DecimalFormat("#.##");

		int sizeOfUid       = minuidsize   + (int)(Math.random() * maxuidsize);
		int sizeOfSummary   = minsumsize   + (int)(Math.random() * maxsumsize);
		int sizeOfOrganizer = minorgsize   + (int)(Math.random() * maxorgsize);
		int classChoice     = 0            + (int)(Math.random() * 2         );
		double latChoice    = -90.0        + (Math.random()      * 90.0      );
		double lonChoice    = -180.0       + (Math.random()      * 180.0     );

		RandomString myRS1 = new RandomString(sizeOfUid);
		RandomString myRS2 = new RandomString(sizeOfSummary);
		RandomString myRS3 = new RandomString(sizeOfOrganizer);

		UID       = myRS1.nextString();
		SUMMARY   = myRS2.nextString();
		ORGANIZER = myRS3.nextString();
		CLASS     = classOptions[classChoice];
		GEO       = new Geo(df.format(latChoice) + ";" + df.format(lonChoice));
		DTSTAMP   = getRandomDate();
		DTSTART   = getRandomDate();
		DTEND     = getRandomDate();
		COMMENT   = myRS1.nextString();

		//ensure that the stamp is lesser than the start date of the event
		while(dateIsGreaterThanDate(DTSTAMP, DTSTART))
		{
			DTSTART = getRandomDate();
		}

		//ensure that the date end is lesser than the date start
		while(dateIsGreaterThanDate(DTSTART, DTEND))
		{
			DTEND = getRandomDate();
		}

		//DEBUG OUTPUT
		/*
		System.out.println("UID:       " + UID);
		System.out.println("SUMMARY:   " + SUMMARY);
		System.out.println("ORGANIZER: " + ORGANIZER);
		System.out.println("CLASS:     " + CLASS);
		System.out.println("GEO:       " + GEO.toString());
		System.out.println("DTSTAMP:   " + DTSTAMP);
		System.out.println("DTSTART:   " + DTSTART);
		System.out.println("DTEND      " + DTEND);
		System.out.println("COMMENT    " + COMMENT);
		*/
	}

	private String getRandomDate()
{'fraction_non_alphanumeric': 0.1207998688739551, 'fraction_numerical': 0.02442222586461236, 'mean_word_length': 3.2881236823612086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '3039005', 'n_tokens_mistral': 2410, 'n_tokens_neox': 2090, 'n_words': 460}