auto_bus/include/controller.h

90 lines
1.7 KiB
C
Raw Normal View History

2022-05-06 11:55:30 +08:00
//
// Created by ricardo on 2022/5/6.
//
#ifndef AUTO_PILOT_BUS_CONTROLLER_H
#define AUTO_PILOT_BUS_CONTROLLER_H
2022-05-17 20:22:29 +08:00
#include "stdlib.h"
2022-05-06 11:55:30 +08:00
#include "rail.h"
#include "query.h"
2022-05-17 20:22:29 +08:00
#include "bus.h"
/**
*
*/
extern bus_query_t *target_query;
/**
*
*/
extern int chosen_strategy;
2022-05-17 20:22:29 +08:00
2022-05-06 11:55:30 +08:00
/**
2022-05-17 20:22:29 +08:00
*
* @return
2022-05-06 11:55:30 +08:00
*/
int FCFSDirection();
2022-05-06 11:55:30 +08:00
/**
2022-05-17 20:22:29 +08:00
*
* @return
*/
bus_query_t *FCFSQuery();
/**
* SSTF策略下应该处理的请求
* @return
*/
bus_query_t *SSTFGetQuery();
/**
*
* SSTF策略中使用
* @param query
* @return
*/
int SSTFDirection(bus_query_t* query);
/**
* 便
* @param direction
* @return
*/
bus_query_t *SSTFBTWQuery(int direction);
/**
* SCAN策略下应该处理的请求
* @return
*/
bus_query_t *SCANGetQuery(int direction);
/**
*
* SCAN策略中使用
* @param query
* @return
*/
int SCANDirection(bus_query_t *query, int orientation);
/**
* 便
* @return
*/
bus_query_t *SCANBTWQuery();
/**
* FCFS策略的控制函数
*/
void FCFSControl();
/**
* SSTF策略的控制函数
*/
void SSTFControl();
/**
* SCAN策略的控制函数
*/
void SCANControl();
2022-05-06 11:55:30 +08:00
#endif //AUTO_PILOT_BUS_CONTROLLER_H