基于贪心算法的宿舍分配系统的设计与实现.docx
本科毕业设计论文题目:基于贪心算法的宿舍分配系统的设计与实现在高校中,学生宿舍分配是大学校园宿舍管理中的重要环节,传统的手动分配学生宿舍的方法费时费力,且难以确保公平性和效率。使用计算机管理系统来管理学生宿舍成为一种常态化的方式,现有的宿舍分配系统虽然实现了宿舍分配的基本功能,但是没有考虑到学生的性格特点,作息时间等实际因素,只是对学生进行了随机分配,导致一些学生和同宿舍其他学生相处困难,影响学习和生活。本系统在原有的分配系统基础上使用了贪心算法,根据收集的学生问卷调查数据对宿舍进行个性化的自动分配,既可以减轻学校宿舍管理者的工作负担,还能够满足学生的偏好、习惯和需求。本系统的主要功能是利用贪心算法实现对学生宿舍的自动分配。贪心算法是一种常用的优化算法,它通过不断做出局部最优选择来达到全局最优。在系统中,通过对学生的作息时间、性格特点、兴趣爱好进行问卷调查,将这三方面作为特征项,给每个特征项根据其重要程度赋予相应的权值,通过计算可以得到学生偏好的量化值,将量化值排序,然后根据学生班级,性别等信息对排序结果进行分组,再获取待分配的宿舍信息,按照每个宿舍容纳的人数进行分配,这样就把偏好量化值相近的学生分配在同一个宿舍。若个别学生对宿舍分配情况不满意,提出调换宿舍的申请,管理员对这些申请信息进行处理即可。本文所提出的算法不仅可以自动分配宿舍,而且还可以考虑到学生的性格特点,生活习惯等因素,既提高了宿舍的分配效率,又提供了一种个性化分配学生宿舍的方式。系统采用B/S模式,前后端分离的架构,使用JAVA语言进行开发,前端应用Vuejs框架,后端使用SSM框架,MySQ1.作为后台数据库,使用InteHiJlDEA、VisualStudioCode和NaViCatPremiUm开发工具进行开发。系统包括用户管理、学生信息管理、宿舍信息管理、自动分配宿舍、宿舍分配情况管理、学生申请管理等功能模块。实现了高校宿舍分配的个性化、自动化,为宿舍管理者和在校学生提供了更好的服务。关键词:贪心算法;学生宿舍分配系统;自动分配论文类型:工程设计AbstractInuniversities,theallocationofstudentdormitoriesisanimportantpartofcampusdormitorymanagement.Thetraditionalmanualallocationofstudentdormitoriesistime-consumingandlaborious,anditisdifficulttoensurefairnessandefficiency.Theuseofcomputermanagementsystemstomanagestudentdormitorieshasbecomeanormalizedapproach.Althoughexistingdormitoryallocationsystemshaveimplementedthebasicfunctionsofdormitoryallocation,theyhavenottakenintoaccountstudents'personalitytraits,workandresttime,andotherpracticalfactors.Theyonlyallocatestudentsrandomly,resultingindifficultiesforsomestudentstogetalongwithotherstudentsinthesamedormitory,affectingtheirlearningandlife.Thissystemusesgreedyalgorithmsonthebasisoftheoriginalallocationsystem,andpersonalizedautomaticallocationofdormitoriesiscarriedoutbasedoncollectedstudentsurveydata.Thiscannotonlyreducetheworkloadofschooldormitorymanagers,butalsomeetthepreferences,habits,andneedsofstudents.Themainfunctionofthissystemistousegreedyalgorithmstoachieveautomaticallocationofstudentdormitories.Greedyalgorithmisacommonlyusedoptimizationalgorithmthatachievesglobaloptimizationbycontinuouslymakinglocaloptimalchoices.Inthesystem,aquestionnairesurveyisconductedonstudents'dailyroutines,personalitytraits,andinterests.Thesethreeaspectsareusedasfeatureitems,andeachfeatureitemisgivencorrespondingweightsbasedonitsimportance.Bycalculatingthequantitativevaluesofstudents*preferences,thequantitativevaluesaresorted.Then,thesortingresultsaregroupedbasedoninformationsuchasstudents'classandgender,andthedormitoryinformationtobeallocatedisobtained,Allocateaccordingtothenumberofpeopleaccommodatedineachdormitory,sothatstudentswithsimilarpreferencequantificationvaluesareassignedtothesamedormitory.Ifindividualstudentsarenotsatisfiedwiththeallocationofdormitories,theycanapplyforadormitoryexchange,andtheadministratorcanprocessthisapplicationinformation.Thealgorithmproposedinthispapercannotonlyautomaticallyallocatedormitories,butalsotakeintoaccountstudents*personalitycharacteristics,livinghabitsandotherfactors,whichnotonlyimprovestheallocativeefficiencyofdormitories,butalsoprovidesapersonalizedwaytoallocatestudentdormitories.ThesystemadoptsaB/Smode,withafront-endandback-endseparatedarchitecture,andisdevelopedusingJAVAlanguage.Thefront-endusestheVuejsframework,andtheback-endusestheSSMframework.MySQ1.servesastheback-enddatabase,andIntelliJIDEA,VisualStudioCode,andNavicatPremiumdevelopmenttoolsareusedfordevelopment.Thesystemincludesfunctionalmodulessuchasusermanagement,studentinformationmanagement,dormitoryinformationmanagement,automaticdormitoryallocation,dormitoryallocationsituationmanagement,andstudentapplicationmanagement.Wehaveachievedpersonalizedandautomatedallocationofdormitoriesinuniversities,providingbetterservicesfordormitorymanagersandstudentsoncampus.KeyWords:GreedyAlgorithm;Studentdormitorydistributionsystem;Automaticallocation;目录摘要IAbstractII目录IV1 .引言11.1 系统开发的背景11.2 本课题的研究意义11.3 本课题的基本内容11.4 本课题的重点和难点21.5 论文提纲32 .系统分析42.1 系统概述42.1.1 系统的总体功能需求和性能需求42.1.2 系统开发框架52.2 可行性分析62.2.1 经济可行性72.2.2 技术可行性72.2.3 操作可行性72.2.4 法律可行性72.3 系统功能分析83 .需求分析93.1 业务流程93.2 系统范围113.3 数据流图123.4 数据字典与加工说明144 .总体设计174.1 系统总体结构设计174.2 系统的接口设计174.2.1 用户接口174.2.2 外部接口194.2.3 内部接口194.3 软件体系结构215 .详细设计225.1 功能模块设计225.2 输入/输出格式设计245.3 人机对话设计255.4 界面设计265.4.1 用户界面设计265.4.2 菜单设计335.4.3 对话框设计355.4.4 窗口选项卡界面设计355.5 数据库设计355.5.1 概念结构设计355.5.2 逻辑结构设计385.5.3 物理结构设计395.5.4 数据库安全456 .系统实现466.1 实现工具466.2 开发平台466.3 技术框架主要功能模块流程和编码476.4 本课题中的关键技术506.4.1 设计中要解决的主要问题506.4.2 贪心算法507 .系统的测试与维护527.1 测试用例和测试结果527.2 系统维护54结论55参考文献56致谢57附录581.引言当今社会,随着信息技术的飞速发展和广泛应用,计算机在各个领域中的作用越来越重要。在高校中,学生宿舍分配是大学校园宿舍管理中的重要环节,传统的手动分配学生宿舍方法费时费力,且难以确保公平性和效率。使用计算机系统管理学生宿舍成为一种常态化的方式,然而现存的宿舍分配系统只是对学生进行了随机分配,这就有可能导致学生和同宿舍的其他学生由于个人习惯等方面的差异而产生矛盾和冲突,严重影响学生的学习和生活。本文介绍了一种个性化的学生宿舍分配系统,通过对学生实际情况进行调查,由系统采用贪心算法进行宿舍的自动分配,旨在解决对学生随机分配宿舍所产生的问题的同时,节省高校人力、物力等资源,降低宿舍的管理成本,实现学生宿舍分配工作的科学化、现代化建设的目标,促进高校校园信息化建设的进一步发展。1.1 系统开发的背景随着社会的发展,高校招生规模