演讲比赛流程管理系统(简陋版)

Person.h

#pragma once
#include<iostream>
using namespace std;
#include<vector>
#include<string>
class Person
{
public:Person() {};// 构造函数,初始化Person(string name, int id);// 获取姓名string& getName();// 给姓名赋值void setName(const string& name);// 获取idint& getId();// 赋值idvoid setId(const int& id);// 获取评委的评分容器vector<double>& getVScore();// 赋值评委的评分容器void setVScore(const vector<double>& v);// 获取最终分数double* getScore();// 赋值最终分数void setScore(double* score);// 获取最终名次int& getRank();// 赋值最终名次void setRank(const int& rank);// 打印评委打分分数void showVScore();// 析构函数~Person();
private:string name; // 姓名int id; // 选手号double score[2]; // 记录两轮比赛最终分数,也就是去除最高分与最低分的平均值vector<double> vScore; // 用来存放评委打的分数int rank;//本次比赛排名
};

Person.cpp

#define _CRT_SECURE_NO_WARNINGS 
#include<iostream>
using namespace std;
#include"Person.h"// 构造函数,初始化
Person::Person(string name,int id)
{this->id = id;this->name = name;this->rank = 0;for (int i = 0; i < 2; i++){this->score[i] = 0;}this->vScore.clear();
}// 获取姓名
string&	Person::getName()
{return this->name;
}// 给姓名赋值
void Person::setName(const string& name)
{this->name = name;
}// 获取id
int& Person::getId()
{return this->id;
}// 赋值id
void Person::setId(const int& id)
{this->id = id;
}// 获取评委的评分容器
vector<double>& Person::getVScore()
{return this->vScore;
}// 赋值评委的评分容器
void Person::setVScore(const vector<double>& v)
{this->vScore = v;
}// 获取最终分数
double* Person::getScore()
{return this->score;
}// 打印评委打分分数
void Person::showVScore()
{for (int i = 0; i < this->vScore.size(); i++){cout << this->vScore[i] << " ";}
}// 赋值最终分数
void Person::setScore(double* score)
{for (int i = 0; i < 2; i++){this->score[i] = score[i];}
}// 获取最终名次
int& Person::getRank()
{return this->rank;
}// 赋值最终名次
void Person::setRank(const int& rank)
{this->rank = rank;
}// 析构函数
Person::~Person()
{}

SpeakManager.h

#pragma once
#include<stdio.h>
using namespace std;
#include<vector>
#include"Person.h"
#include<map>
class SpeakManager
{
public:// 构造函数SpeakManager();// 显示菜单void showManu();// 退出程序void exitSystem();// 开始比赛void speakContest();// 获取第一轮容器vector<Person>& getVPersonOne();// 赋值第一轮容器void setVPersonOne(const vector<Person>& v);// 获取第二轮容器vector<Person>& getVPersonTwo();// 赋值第二轮容器void setVPersonTwo(const vector<Person>& v);// 获取胜利容器vector<Person>& getVVictor();// 赋值胜利容器void settVVictor(const vector<Person>& v);// 获取文件状态bool getIsFileEmpty();// 更改文件状态void setIsFileEmpty(bool isFileEmpty);// 参数初始化void inti();// 获取比赛场数int& getSession();// 更改比赛场数void setSession();// 创建12名选手void createrPerson();// 打印void printVectorPerson(vector<Person>& v);// 将比赛结果记录到文件中void recordToFile();// 2.查询往届记录void searchRecord();// 3.清空比赛记录void clearAll();//析构函数~SpeakManager();private:vector<Person> vPersonOne; // 用来存放第一轮比赛选手vector<Person> vPersonTwo; // 用来存放第二轮比赛选手vector<Person> vVictor; // 用来存放最终获胜的三名选手bool isFileEmpty; // 用来记录文件状态int session; // 记录比赛场数map<int, vector<string>> m; // 存放往届记录
};

SpeakManager.cpp

#define _CRT_SECURE_NO_WARNINGS 
#include<iostream>
using namespace std;
#include"SpeakManager.h"
#include<algorithm>
#include<numeric>
#include<functional>
#include<map>
#include<fstream>
// 构造函数
SpeakManager::SpeakManager()
{// 参数初始化this->inti();this->m.clear();
}// 参数初始化
void SpeakManager::inti()
{this->vPersonOne.clear();this->vPersonTwo.clear();this->vVictor.clear();this->isFileEmpty = false; // 文件默认状态为空this->session = 0;
}// 显示菜单
void SpeakManager::showManu()
{cout << "********************************************" << endl;cout << "************* 欢迎参加演讲比赛 ************" << endl;cout << "************* 1.开始演讲比赛 *************" << endl;cout << "************* 2.查看往届记录 *************" << endl;cout << "************* 3.清空比赛记录 *************" << endl;cout << "************* 0.退出比赛程序 *************" << endl;cout << "********************************************" << endl;cout << endl;
}// 退出程序
void SpeakManager::exitSystem()
{int choose;cout << "是否确认退出程序" << endl<< "1.确认" << endl<< "其它:取消" << endl;cin >> choose;if (choose == 1){cout << "退出成功,欢迎下次使用!" << endl;system("pause");system("cls");exit(0);}else{system("pause");system("cls");return;}
}// 获取第一轮容器
vector<Person>& SpeakManager::getVPersonOne()
{return this->vPersonOne;
}// 赋值第一轮容器
void SpeakManager::setVPersonOne(const vector<Person>& v)
{this->vPersonOne = v;
}// 获取第二轮容器
vector<Person>& SpeakManager::getVPersonTwo()
{return this->vPersonTwo;
}// 赋值第二轮容器
void SpeakManager::setVPersonTwo(const vector<Person>& v)
{this->vPersonTwo = v;
}// 获取胜利容器
vector<Person>& SpeakManager::getVVictor()
{return this->vVictor;
}// 赋值胜利容器
void SpeakManager::settVVictor(const vector<Person>& v)
{this->vVictor = v;
}// 获取文件状态
bool SpeakManager::getIsFileEmpty()
{return this->isFileEmpty;
}// 更改文件状态
void SpeakManager::setIsFileEmpty(bool isFileEmpty)
{this->isFileEmpty = isFileEmpty;
}// 获取比赛场数
int& SpeakManager::getSession()
{return this->session;
}// 更改比赛场数
void SpeakManager::setSession()
{this->session = session;
}// 创建12名选手
void SpeakManager::createrPerson()
{string name = "ABCDEFGHIJKL";for (int i = 0; i < name.size(); i++){string str = "选手";this->vPersonOne.push_back(Person(str + name[i], 10001 + i));}
}void SpeakManager::printVectorPerson(vector<Person>& v)
{for (vector<Person>::iterator it = v.begin(); it != v.end(); it++){cout << "选手:" << it->getName() << "  "<< "id号:" << it->getId() << endl;}system("pause");
}void print(Person p)
{cout << "选手:" << p.getName() << "  "<< "id号:" << p.getId() << endl;
}
void print1(Person p)
{cout << "选手:" << p.getName() << "  "<< "id号:" << p.getId() << "  ";p.showVScore();cout << endl;
}void print2(Person p)
{cout << "选手:" << p.getName() << "  "<< "id号:" << p.getId() << "  "<< "最终分数为:" << p.getScore()[0]<< "  "<< "评委打分结果为:";p.showVScore();cout << endl;
}
void print3(Person p)
{cout << "选手:" << p.getName() << "  "<< "id号:" << p.getId() << "  "<< "最终分数为:" << p.getScore()[1] << "  "<< "评委打分结果为:";p.showVScore();cout << endl;
}class MyGreater
{
public:bool operator()(Person p1,Person p2){return p1.getScore()[0] > p2.getScore()[0];}
};
class MyGreater1
{
public:bool operator()(Person p1, Person p2){return p1.getScore()[1] > p2.getScore()[1];}
};// 开始比赛
void SpeakManager::speakContest()
{// 用于记录选手两轮的分数double score[2] = { 0 };// 用于存放第一轮比赛vector<Person> v1;vector<Person> v2;// 用于存放第二轮比赛,自动按照double排序multimap<double, Person> m;if (this->session == 0){cout << "第" << session+1 << "轮淘汰赛正式开始,欢迎各位参赛选手!" << endl;// 创建12名选手并存储在vPersonOne中this->createrPerson();// 显示12名选手this->printVectorPerson(this->vPersonOne);cout << endl;cout << "下面将打乱顺序开始比赛!" << endl;// 打乱顺序random_shuffle(this->vPersonOne.begin(),this->vPersonOne.end());system("pause");cout << endl;cout << "打乱后的顺序为:" << endl;for_each(this->vPersonOne.begin(), this->vPersonOne.end(), print);cout << endl;system("pause");cout << "下面将选手分为两组,结果如下:" << endl;// 将12个人分为两个组v1.resize(this->vPersonOne.size() / 2);v2.resize(this->vPersonOne.size() / 2);//copy(this->vPersonOne.begin(), this->vPersonOne.begin() + 6,v1.begin());//copy(this->vPersonOne.begin()+6, this->vPersonOne.end(), v2.begin());v1.assign(this->vPersonOne.begin(), this->vPersonOne.begin() + 6);v2.assign(this->vPersonOne.begin()+6, this->vPersonOne.end());cout << "第一组选手为:" << endl;for_each(v1.begin(),v1.end(),print);cout << "第二组选手为:" << endl;for_each(v2.begin(), v2.end(), print);cout << endl;system("pause");cout << "下面两组进行比赛,请10位评委老师打分!" << endl;// 第一层循环遍历选手for (int i = 0; i < v1.size(); i++){// 第二层循环遍历评委老师打分for (int j = 0; j < 10; j++){// (rand()%60+40)/10.f  0-9.9分v1[i].getVScore().push_back((rand() % 60 + 40) / 10.f);v2[i].getVScore().push_back((rand() % 60 + 40) / 10.f);}// 计算最终得分score[this->session] = accumulate(v1[i].getVScore().begin(), v1[i].getVScore().end(), 0)/ (double)(v1[i].getVScore().size() - 2);v1[i].setScore(score);score[this->session] = accumulate(v2[i].getVScore().begin(), v2[i].getVScore().end(), 0)/ (double)(v2[i].getVScore().size() - 2);v2[i].setScore(score);}// 在这里还可以将选手信息更新到this->vPersonOne中// 不弄了system("pause");cout << endl;cout << "打完分之后未排序的选手信息:" << endl;cout << endl;cout << "第一组信息为:" << endl;for_each(v1.begin(), v1.end(), print1);cout << endl;cout << "第二组信息为:" << endl;for_each(v2.begin(), v2.end(), print1);system("pause");cout << endl;cout << "打完分之后有得分未排序后的选手信息:" << endl;cout << endl;cout << "第一组信息为:" << endl;for_each(v1.begin(), v1.end(), print2);cout << endl;cout << "第二组信息为:" << endl;for_each(v2.begin(), v2.end(), print2);// 对最终得分进行排序sort(v1.begin(), v1.end(), MyGreater());sort(v2.begin(), v2.end(), MyGreater());system("pause");cout << endl;cout << "打完分之后有得分排序后的选手信息:" << endl;cout << endl;cout << "第一组信息为:" << endl;for_each(v1.begin(), v1.end(), print2);cout << endl;cout << "第二组信息为:" << endl;for_each(v2.begin(), v2.end(), print2);system("pause");cout << endl;cout << "淘汰后三名后的选手信息:" << endl;cout << endl;v1.resize(3);v2.resize(3);cout << "第一组信息为:" << endl;for_each(v1.begin(), v1.end(), print2);cout << endl;cout << "第二组信息为:" << endl;for_each(v2.begin(), v2.end(), print2);// 将晋级的选手放入this->vPersonTwo中system("pause");cout << "=======================================" << endl;for (int i = 0; i < 3; i++){this->vPersonTwo.push_back(v1[i]);this->vPersonTwo.push_back(v2[i]);}for_each(this->vPersonTwo.begin(), this->vPersonTwo.end(), print2);this->session++;}if (this->session == 1)// 决赛{system("cls");cout << "下面进行第" << this->session + 1 << "部分,决赛" << endl;// 第一层遍历选手for (int i = 0; i < this->vPersonTwo.size(); i++){// 第二层评委打分// 第二层循环遍历评委老师打分for (int j = 0; j < 10; j++){// (rand()%60+40)/10.f  0-9.9分this->vPersonTwo[i].getVScore().push_back((rand() % 60 + 40) / 10.f);}// 计算最终得分score[this->session] = accumulate(this->vPersonTwo[i].getVScore().begin(), this->vPersonTwo[i].getVScore().end(), 0)/ (double)(this->vPersonTwo[i].getVScore().size() - 2);this->vPersonTwo[i].setScore(score);}system("pause");cout << endl;cout << "打完分之后未排序的选手信息:" << endl;cout << endl;for_each(this->vPersonTwo.begin(), this->vPersonTwo.end(), print1);cout << endl;system("pause");cout << endl;cout << "打完分之后有得分未排序后的选手信息:" << endl;cout << endl;for_each(this->vPersonTwo.begin(), this->vPersonTwo.end(), print3);cout << endl;// 对最终得分进行排序sort(this->vPersonTwo.begin(), this->vPersonTwo.end(), MyGreater1());system("pause");cout << endl;cout << "打完分之后有得分排序后的选手信息:" << endl;cout << endl;for_each(this->vPersonTwo.begin(), this->vPersonTwo.end(), print3);cout << endl;system("pause");cout << endl;cout << "淘汰后三名后的选手信息:" << endl;cout << endl;this->vPersonTwo.resize(3);for_each(this->vPersonTwo.begin(), this->vPersonTwo.end(), print3);cout << endl;// 将晋级的选手放入this->vPersonTwo中/*system("pause");cout << "=======================================" << endl;for (int i = 0; i < 3; i++){this->vPersonTwo.push_back(v1[i]);this->vPersonTwo.push_back(v2[i]);}for_each(this->vPersonTwo.begin(), this->vPersonTwo.end(), print2);*/this->vVictor = this->vPersonTwo;cout << "=======================================" << endl;for_each(this->vVictor.begin(), this->vVictor.end(), print3);this->session = 0; // 决赛打完清零}// 将比赛结果记录到文件中recordToFile();// 清空容器this->inti();
}// 将比赛结果记录到文件中
void SpeakManager::recordToFile()
{ofstream ofs;ofs.open("test.csv", ios::out | ios::app);for (int i = 0; i < this->vVictor.size(); i++){ofs << this->vVictor[i].getName() << "," << this->vVictor[i].getScore()[1] << ",";}ofs << endl;ofs.close();cout << "存储完毕" << endl;this->isFileEmpty = false;
}// 2.查询往届记录
void SpeakManager::searchRecord()
{if (this->isFileEmpty == true){cout << "文件为空或不存在" << endl;}else {ifstream ifs;ifs.open("test.csv", ios::in);char ch;ifs >> ch;if (ifs.eof()){this->isFileEmpty = true;cout << "文件为空或不存在" << endl;}else{this->isFileEmpty = false;ifs.putback(ch);// 将文件内容读取出来string date;int index = 0;while (ifs >> date){int start = 0;vector<string> v;while (true){int pos = -1;pos = date.find(",", start);if (pos == -1){break;}string str = date.substr(start, pos - start);start = pos + 1;v.push_back(str);}m.insert(make_pair(index,v));index++;}}ifs.close();}// 打印往届记录for (int i = 0; i < m.size(); i++){cout << "冠军: " << m[i][0] << "  分数:" << m[i][1]<< "  亚军:" << m[i][2] << "  分数:" << m[i][3]<< "  季军:" << m[i][4] << "  分数:" << m[i][5] << endl;}cout << endl;
}void SpeakManager::clearAll()
{if (this->isFileEmpty){cout << "文件为空或不存在" << endl;}else{ofstream ofs;ofs.open("test.csv", ios::trunc);ofs.close();cout << "清空成功" << endl;this->inti();this->vVictor.clear();this->m.clear();}
}//析构函数
SpeakManager::~SpeakManager()
{}

演讲比赛演讲流程.cpp

#define _CRT_SECURE_NO_WARNINGS 
#include<iostream>
using namespace std;
#include"SpeakManager.h"
#include"Person.h"
#include<algorithm>
#include<string>
#include<ctime>
class Print
{
public:void operator()(Person p){cout << "选手:" << p.getName() << "  "<< "id:" << p.getId() << endl;}};
class MyGreat
{
public:bool operator()(Person p1, Person p2){return p1.getId() > p2.getId();}};
void test01()
{vector<Person> v;v.push_back(Person("111",11));v.push_back(Person("222", 22));v.push_back(Person("333", 33));v.push_back(Person("444", 44));v.push_back(Person("555", 55));v.push_back(Person("666", 66));random_shuffle(v.begin(), v.end());for_each(v.begin(), v.end(), Print());cout << endl;sort(v.begin(), v.end(), MyGreat());for_each(v.begin(), v.end(), Print());
}
int main()
{// test01();srand((unsigned int)time(NULL));SpeakManager  s;int input;while (true){// 显示菜单s.showManu();cout << "请选择您需要的选项:" << endl;cin >> input;switch (input){case 1:// 1.开始演讲比赛s.speakContest();break;	case 2:// 2.查询往届记录s.searchRecord();break;case 3:// 3.清空比赛记录s.clearAll();break;case 0:// 4.退出程序s.exitSystem();break;default:cout << "输入不合法,请重新输入:" << endl;system("pause");system("cls");}}return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1542851.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

stm32 外部中断

1.每个IO都可以配置外部中断&#xff0c;中断的出发方式有上升沿、下降沿、双边沿。这个是在EXTI里配置。 2.所有IO总共分成了16组&#xff0c;&#xff08;PA0,PB0…&#xff09;、&#xff08;PA1,PB1…&#xff09;、&#xff08;PA2,PB2…&#xff09;,…,&#xff08;PA15…

【Proteus仿真】基于51单片机的电机调速和速度实时显示

目录 一、主要功能 二、硬件资源 三、程序编程 四、实现现象 一、主要功能 基于51单片机&#xff0c;可采用按键对电机进行方向的调控和速度的加减&#xff0c;并通过DAC0832设置放大电路进行对电机的设置&#xff0c;通过四位数码管显示电机转向和速度&#xff0c;非常精…

LLMs之PE:AI for Grant Writing的简介、使用方法、案例应用之详细攻略

LLMs之PE&#xff1a;AI for Grant Writing的简介、使用方法、案例应用之详细攻略 目录 AI for Grant Writing的简介 AI for Grant Writing的使用方法—提示资源 1、提示集合 2、提示工程 3、快速提示 为了提高文本清晰度 为了让文本更有吸引力 为了改进文本的结构和流…

变压器设备漏油数据集 voc txt

变压器设备漏油数据集 油浸式变压器通常采用油浸自冷式、油浸风冷式和强迫油循环三种冷却方式。该数据集采集于油浸式变压器的设备漏油情况&#xff0c;一般用于变电站的无人巡检&#xff0c;代替传统的人工巡检&#xff0c;与绝缘子的破损检测来源于同一课题。数据集一部分来自…

LeetCode 2374.边积分最高的节点:模拟

【LetMeFly】2374.边积分最高的节点&#xff1a;模拟 力扣题目链接&#xff1a;https://leetcode.cn/problems/node-with-highest-edge-score/ 给你一个有向图&#xff0c;图中有 n 个节点&#xff0c;节点编号从 0 到 n - 1 &#xff0c;其中每个节点都 恰有一条 出边。 图…

hCaptcha 图像识别 API 对接说明

本文将介绍一种 hCaptcha 图像识别 API 对接说明&#xff0c;它可以通过用户输入识别的内容和 hCaptcha验证码图像&#xff0c;最后返回需要点击的小图像的坐标&#xff0c;完成验证。 接下来介绍下 hCaptcha 图像识别 API 的对接说明。 申请流程 要使用 API&#xff0c;需要…

使用思科搭建企业网规划训练,让网络全部互通,使用规则提高工作效率。

1. 企业背景&#xff1a; 某企业分为销售部、行政部、人力资源部、财务部、业务部、接待中心等主要六个部门&#xff1b;配置网管中心&#xff0c;允许网络管理员登录企业交换机和路由器对企业网络进行管理&#xff1b;配置服务器集群&#xff0c;设置FTP、DNS、WEB服务器&am…

泛微开发修炼之旅--44用友U9与ecology对接方案及源码

文章链接&#xff1a;44用友U9与ecology对接方案及源码

蓝桥杯算法之暴力

暴力 1.十进制数转换成罗马数字 2.判断给出的罗马数字是否正确 小知识 %&#xff08;模除&#xff09;&#xff1a; % 符号用作模除&#xff08;或取模&#xff09;运算符。模除运算是一种数学运算&#xff0c;它返回两个数相除的余数。 具体来说&#xff0c;如果 a 和 b 是…

分布式系统的CAP原理

CAP 理论的起源 CAP 理论起源于 2000 年&#xff0c;由加州大学伯克利分校的 Eric Brewer 教授在分布式计算原理研讨会&#xff08;PODC&#xff09;上提出&#xff0c;因此 CAP 定理又被称作布鲁尔定理&#xff08;Brewer’s Theorem&#xff09;。2002 年&#xff0c;麻省理…

低代码开发平台:高效开发新体验

在数字化转型的浪潮中&#xff0c;企业对软件开发的需求日益加剧&#xff0c;对开发效率和响应市场变化的速度有着前所未有的要求。传统的软件开发方法由于其复杂性和耗时性&#xff0c;已经逐渐难以满足这种快速变化的需求。低代码平台作为一种新兴的开发工具&#xff0c;因其…

C语言理解 —— printf 格式化输出

目 录 printf 函数一、短整型输出二、长整型输出三、浮点型输出四、字符型输出五、字符串输出六、注意问题 printf 函数 在软件开发过程中&#xff0c;通常需要打印一些字符串信息&#xff0c;或把一些变量值输出到上位机显示。打印函数printf是最常用的。 一般格式&#xff…

STM32篇:通用输入输出端口GPIO

一.什么是GPIO? 1.定义 GPIO是通用输入输出端口的简称&#xff0c;简单来说就是STM32可控制的引脚STM32芯片的GPIO引脚与 外部设备连接起来&#xff0c;从而实现与外部通讯、控制以及数据采集的功能。 简单来说我们可以控制GPIO引脚的电平变化&#xff0c;达到我们的各种目的…

文献阅读(220)MRCN

题目&#xff1a;MRCN: Throughput-Oriented Multicast Routing for Customized Network-on-Chips时间&#xff1a;2023期刊&#xff1a;TPDS研究机构&#xff1a;韩国成均馆大学 这篇论文探讨的问题是多播死锁问题&#xff0c;下图中Packet A分成两条路径&#xff0c;但在rou…

伊丽莎白·赫莉为杂志拍摄一组素颜写真,庆祝自己荣膺全球最性感女人第一名

语录&#xff1a;女性应该做任何她们想做的事&#xff0c;批评她们的人都见鬼去吧。 伊丽莎白赫莉为《Maxim》杂志拍摄一组素颜写真&#xff0c;庆祝自己荣膺全球最性感女人第一名 伊丽莎白赫莉 (Elizabeth Hurley) 实在是太惊艳了&#xff0c;如今&#xff0c;《马克西姆》杂…

对话Chat和续写Completion的区别

版权声明 本文原创作者&#xff1a;谷哥的小弟作者博客地址&#xff1a;http://blog.csdn.net/lfdfhl 对话Chat 对话Chat功能主要适用于模拟人类对话的场景&#xff0c;例如智能客服、智能问答和聊天机器人等。它允许用户与模型进行多轮次交互&#xff0c;从而模拟真实的对话…

Python中的数据可视化:从基础图表到高级可视化

数据可视化是数据分析和科学计算中不可或缺的一部分。它通过图形化的方式呈现数据&#xff0c;使复杂的统计信息变得直观易懂。Python提供了多种强大的库来支持数据可视化&#xff0c;如Matplotlib、Seaborn、Plotly等。本文将从基础图表入手&#xff0c;逐步介绍如何使用这些库…

mybatis 配置文件完成增删改查(一):直接查询所有信息

文章目录 编写三步走查询所有编写接口方法编写sql语句执行方法&#xff0c;测试结果数据库字段名和实体类变量名不一致&#xff1a;ResultMap数据库字段名和实体类变量名不一致&#xff1a;方法二 编写三步走 编写接口方法&#xff1a;Mapper接口 参数有无 结果类型编写sql语句…

分布式环境中解决主从延时的一些思路

目录标题 MySQL主从复制复习为什么要做主从复制&#xff1f;主从复制的原理主从延迟的原因&#xff1f; 解决思路1. 读写分离与延迟容忍2. 异步复制优化3. 缓存机制&#xff08;常用&#xff09;4. 最终一致性方案&#xff08;常用&#xff09;5. 主从切换与自动故障恢复&#…

多无人机通信(多机通信)+配置ssh服务

目录 多机通信 设备 主从机通信设置 配置从机 配置主机 测试 正式启用 MAVROS通信 多机通信 多机通信是实现机器人编队的基础&#xff0c;通过网络搭建通信链路。我们这里用中心节点网络通信&#xff0c;所有数据需有经过中心节点&#xff0c;所以&#xff0c;中心节点…