-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectricVehicle.h
26 lines (23 loc) · 887 Bytes
/
electricVehicle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#define MODEL_NAME_LEN 25
#define FILE_MAX_LINE 100
#define FILE_LINE_LENGTH 40
#define OPTIONS_LENGTH 4
typedef struct {
float chargeRate;
float capacity;
float charge;
char modelName[MODEL_NAME_LEN];
int numOfEV;
float kmPrKwh;
}electricVehicle;
void chargeEV(spotPrices priceArray[]);
int getSumOfEvs(electricVehicle array[], int arrayLen);
void setEvArrayValues(electricVehicle arrayFile[], int arrayFileLen, electricVehicle evArray[], int evArrayLen);
void setBatteryCharge(electricVehicle evArray[], int evArrayLen);
void printEV(electricVehicle array[], int arrayLength);
void chargeAndPrintEV(electricVehicle evArray[], int evArrayLen, spotPrices elPrArray[]);
int chargeEvOneHour(electricVehicle evArray[], int evArrayLen, int evToCharge, double maxLoad, double* evCharge);