<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "global.h"
#include "passenger.h"
#include "window.h"

#define MaxGapTime 5 //ʱΪλ
#define	OneOutOfTen 1 + rand() % 100 > 90	//10%ΪϢĸ
#define MaxCrown 10 //һ 

void MainInput();
void AirportOnServe();
double random();

double random()  //ֲ̬ɺ
{
	double U1, U2, W, mult;
	static double X1, X2;
	static int call = 0;
	int mu = 0;
	int sigma = 1;

	srand(time(NULL));

	if (call == 1)
	{
		call = !call;
		return (mu + sigma * (double)X2);
	}

	do
	{
		U1 = -1 + ((double)rand() / RAND_MAX) * 2;
		U2 = -1 + ((double)rand() / RAND_MAX) * 2;
		W = pow(U1, 2) + pow(U2, 2);
	} while (W >= 1 || W == 0);

	mult = sqrt((-2 * log(W)) / W);
	X1 = U1 * mult;
	X2 = U2 * mult;

	call = !call;

	return fabs((mu + sigma * (double)X1) / 3);
}

void MainInput() {
		
	FILE *finput = fopen("input.dat", "wb+");
	
	extern struct entry event[100];
	if (finput) {
		for (int i = 0; i < 99; i++) {

			event[i].no = i;
			event[i].sec = (int)(random() * MaxGapTime + 1); //ֲ̬1MaxGapTimeʱ

			if (OneOutOfTen) {		//10%ĸΪرհ
				event[i].type = 'X';
				event[i].check = 1 + rand() % MaxCheck;
				event[i].mans = 0;
			}
			else {
				event[i].type = 'G';
				event[i].mans = (int)(random() * MaxCrown + 1);
				event[i].check = 0;
			}
		}
		event[99].type = 'Q';
		fwrite(&event, sizeof(struct entry), 100, finput);
	}
	else {
		printf("ļʧܣ");
		exie(EXIT_FAILURE);
	}
	fclose(finput);
}

void AirportOnServe() {
	

}<commit_msg>输入函数1.0版<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "global.h"
#include "passenger.h"
#include "window.h"

#define MaxGapTime 5 //ʱΪλ
#define	OneOutOfTen 1 + rand() % 100 > 90	//10%ΪϢĸ
#define MaxCrown 10 //һ 

void MainInput();
void AirportOnServe();
double random();

double random()  //ֲ̬ɺ
{
	double U1, U2, W, mult;
	static double X1, X2;
	static int call = 0;
	int mu = 0;
	int sigma = 1;

	srand(time(NULL));

	if (call == 1)
	{
		call = !call;
		return (mu + sigma * (double)X2);
	}

	do
	{
		U1 = -1 + ((double)rand() / RAND_MAX) * 2;
		U2 = -1 + ((double)rand() / RAND_MAX) * 2;
		W = pow(U1, 2) + pow(U2, 2);
	} while (W >= 1 || W == 0);

	mult = sqrt((-2 * log(W)) / W);
	X1 = U1 * mult;
	X2 = U2 * mult;

	call = !call;

	return fabs((mu + sigma * (double)X1) / 3);
}

void MainInput() {
		
	FILE *finput = fopen("input.dat", "wb+");
	
	struct entry event[100];
	if (finput) {
		for (int i = 0; i < 99; i++) {

			event[i].no = i;
			event[i].sec = (int)(random() * MaxGapTime + 1); //ֲ̬1MaxGapTimeʱ

			if (OneOutOfTen) {		//10%ĸΪرհ
				event[i].type = 'X';
				event[i].check = 1 + rand() % MaxCheck;
				event[i].mans = 0;
			}
			else {
				event[i].type = 'G';
				event[i].mans = (int)(random() * MaxCrown + 1);
				event[i].check = 0;
			}
			event[i].ev_valid = 0;
		}
		event[99].type = 'Q';
		fwrite(&event, sizeof(struct entry), 100, finput);
	}
	else {
		printf("ļʧܣ");
		exie(EXIT_FAILURE);
	}
	fclose(finput);
}

void AirportOnServe() {
		
	time_t time_pre_ev = TimeStart;
	time_t temtime;
	FILE *finput = fopen("input.dat", "rb+");

	extern struct entry thisEvent;

	fread(&thisEvent, sizeof(struct entry), 1, "finput");
	if (time(&temtime)> thisEvent.sec + time_pre_ev) {
		time_pre_ev = clock();
		fread(&thisEvent, sizeof(struct entry), 1, "finput");
	}
}
{'fraction_non_alphanumeric': 0.20422960725075529, 'fraction_numerical': 0.036555891238670694, 'mean_word_length': 3.047677261613692, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '1402325', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1482, 'n_words': 354}