1. 楼层由上至下依次编号为9,8,7,6,5,4,3,2,1,0。
每层都有向上和向下两个按钮,对应20个变量callup[0...9]和calldown[0...9]。
电梯内10个目标层按钮对应变量out[0...9]。
有人按下某个按钮时,相应的变量就增1,一旦要求满足后,该变量就减1。
当有多人的需求相同时,相应的处理时间就增长,用于模拟真实的情况。
2. 电梯处于三种状态之一:UP(上行),DOWN(下行)和Idle(等候)。
如果电梯处于Idle状态且不在1层超过20个时间单位时,则驶回1层。
当电梯处于Idle状态时,一旦收到前往另一层的命令,就转入UP或DOWN状态,执行相应的操作。
3. 其它重要的变量有:floor----当前电梯外乘客所在楼层;
calling----当前电梯外按下按钮的乘客所在的楼层;
up_or_down----电梯外某层按钮的状态(向上箭头或向下箭头);
waittime----电梯空闲时的等待时间;
total----电梯内的总人数(上限为15人);
电梯的数据结构:state----电梯的状态(UP,DOWN,IDLE)current-----电梯目前所处楼层imovingto----电梯的目标楼层队列成员的数据结构:floor―――所在楼层up_down―――目标方向(向上或向下)structqueue*next―――指向下一个成员4. 【进入排队】先在等候队列中查找,若有信息相同(所在楼层相同,目标方向一致)的成员,则对队列无任何操作。
若没有,则在队列末尾插入该人。
5. 【进入电梯】电梯根据人数停留一定时间单位,每进入一个人,从队列中删除该人,callup[ele.current]或者calldown[ele.current]减一,total加一。
6. 【走出电梯】电梯根据人数停留一定时间单位,每出去一个人out[ele.current]减一.7. 【电梯的活动】E1.[在一楼停候]若有人按下一个按钮,则调用相关函数(比如入队,置楼层标志位为1等)处理当前事件.E2.[改变状态]如果电梯处于Up(或Down)状态,但该方向的楼层却无人等待,则要看反方向楼层是否有人等待,而决定置State为Down(或Up)还是Idle。
E3.[让人出入]如果电梯不空且out[ele.current]!=0时,则电梯等候在该楼层出电梯的人离开。
接着检验在该楼层是否有等候前往同一方向去的乘客,若有则等候他们进入电梯。
总原则是先下后上。
E4.[在某楼层(非1楼)停候]若电梯到达目标楼层后,队列为空,则电梯在该楼层停候一定时间,在停候期间若有新的呼叫,则立即转入处理程序处理,否则返回一楼停候。
8. 电梯在上升或下降过程中需要不停地对当前方向上的最终楼层作调整。
比如当前向上,最终楼层为6楼,而有乘客在8楼按了按钮,则最终楼层调整为8楼。
相反方向同理。
2024/4/2 8:05:07 59KB 电梯模拟 用C语言写的
1
ReactNative自定义操作表这是什么?该组件将淡入/淡出叠加层,并使用取消按钮以弹出方式弹出。
您可以将所需的任何视图传递给组件,该视图将显示在模式中。
在下面的示例中,我传递了一个日期选择器。
安装npminstallreact-native-custom-action-sheet--save用法示例varCustomActionSheet=require('react-native-custom-action-sheet');varSomeComponent=React.createClass({render:function(){return(<CustomActionSheetmodalVisible={this.state.mod
2024/4/1 15:16:19 5KB JavaScript
1
使用STM32战舰版,网上购买的HC-05模块,PA2-RXD,PA3-TXD,VCC-5V,GND-GND,STATE和EN不连。
注意使用的串口为两个,串口二的PA2和PA3连接蓝牙模块,串口一需要和战舰板上的TXD和RXD连接。
另外连接完成后,需要按下蓝牙模块的按键,这样战舰版才能查询到蓝牙模块,使用安卓手机下载一个蓝牙串口助手,连接HC-05模块,输入1,2,3,可以实现两个LED灯的亮灭。
2024/3/29 8:51:04 1.94MB HC-05 HC-05蓝牙模块 STM32-HC-05蓝牙
1
LearnGoogleFlutterbyexample.Over65examplemini-apps.ChaptersInclude:ThreeChaptersonDartLanguage.IntroductiontoFlutter.InstallingFlutter.YourfirstFlutterApp.Dependencies&Packages.IntroductiontoWidgets&Composition.StatelessWidgets.StatefulWidgets.BasicMaterialWidgets.Multi-ChildWidgets.Single-ChildWidgets.AppScaffoldingWidgets.OtherWidgets.Builders.Routing&Navigation.Forms.Http,Apis,REST&JSON.FlutterwithHttp,Apis,REST&JSON.State.State&StatefulWidgets.State&InheritedWidgets.State&ScopedModel.State&BLoCswithStreams.LocalPersistence.Mixins.Debugging&PerformanceProfiling.
2024/3/7 23:18:21 11.31MB Flutter
1
第1章至第11章陆续介绍了设计模式:Strategy、Observer、Decorator、Abstract Factory、Factory Method、Singleton、Command、Adapter、Facade、TemplatMethod、Iterator、Composite、State、Proxy。
2023/12/27 10:49:23 763KB Head First 设计模式 官方源码
1
PetrifyisatoolforthesynthesisofboundedPetrinetsandlogicsynthesisofasynchronouscontrollers.PetrifyinitiallyperformsatokenflowanalysisofthePetrinetandproducesafinitetransitionsystem(TS).IntheinitialTS,alltransitionswiththesamelabelareconsideredasoneevent.TheTSisthentransformedandtransitionsrelabeledtofulfiltheconditionsrequiredtoobtainaPetrinetwithbisimilarortrace-equivalentbehavior.SomepropertiesforthesynthesizedPetrinetcanbeimposed(e.g.free-choice,uniquechoice,pure,state-machinedecomposable,etc.).Additionally,petrifycaninterpretthePetrinetasaSignalTransitionGraph(STG),inwhicheventsrepresentrising/fallingtransitionsofdigitalsignals.FromanSTG,petrifycansynthesizeaspeed-independentcircuitbysolvingtheproblemsofstateencoding,logicsynthesis,logicdecompositionandtechnologymappingontoagatelibrary.Petrifycanalsosynthesizecircuitundertimingassumptionsspecifiedbythedesignerorautomaticallygeneratedbythetool.PetrifyreadstheinputdescriptionfromstdinandwritestheresultingSTGtostdoutunlessotherwisespecified
2023/12/1 6:46:18 1.07MB Asynchronous Synthesis
1
react-state-treereact-state-tree是useState替代品,useState您的状态持久化到存储在顶级提供程序组件中的类似redux的状态树中。
如果您使用useStateTree在没有应用程序StateTreeProvider,它会回落到useState。
因此,在自定义挂钩和组件中使用是安全的。
教程要开始使用react-state-tree,请使用StateTreeProvider包装您的应用程序:import{StateTreeProvider}from"react-state-tree";functionApp(){return({/*addedStateTreeProvider*/}<
2023/11/23 20:56:02 64KB TypeScript
1
Inordertoimprovethetrackingandstabilizationperformanceofthree-axisgyrostabilizedplatform,anadaptivedecouplingcontrolbasedonneuralnetworksisdeveloped.Thedynamicmodelofthree-axisGSPisdevelopedbasedontraditionalNewton–Eulermethod.Thenonlinearityandcouplingsystemisfull-state-linearizedusingfeedbacklinearization,andneuralnetworksareusedtocompensateforthedisturbancesanduncertainties.Thestabilityoftheproposedschemeisanalyzedbythe
2023/11/9 11:11:39 1.41MB Gyro stabilized platform; Decoupling;
1
序号成员变量意义或操作方法1进程名称ID进程的标识2优先数PRIORITY越大优先权越高,在运行期间可以被动态改变。
3到达时间ENTERTIME进程输入的时间4进程余下运行时间ALLTIME进程开始为全部时间,运行完毕ALLTIME=05已使用CPU时间USEDTIME每在CPU上运行1个时间片就加16连续运行时间RUNTIME进程就绪前已经连续运行RUNTIME个时间片7连续就绪时间READYTIME进程运行前已连续就绪READYTIME个时间片8进程状态STATE三个状态:READY、RUNNING、FINISHED9队列指针NEXT用来将PCB排成队列
2023/9/4 2:56:28 36KB 操作系统
1
Withtheongoingreleaseof3Dmoviesandtheemergenceof3DTVs,3Dimagingtechnologieshavepenetratedourdailylives.Yetchoosingfromthenumerous3Dvisionmethodsavailablecanbefrustratingforscientistsandengineers,especiallywithoutacomprehensiveresourcetoconsult.Fillingthisgap,Handbookof3DMachineVision:OpticalMetrologyandImaginggivesanextensive,in-depthlookatthemostpopular3Dimagingtechniques.Itfocusesonnoninvasive,noncontactopticalmethods(opticalmetrologyandimaging).Thehandbookbeginswiththewell-studiedmethodofstereovisionandexplainshowrandomspecklepatternsorspace-timevaryingpatternssubstantiallyimprovetheresultsofstereovision.Itthendiscussesstereoparticleimagevelocimetryasamajorexperimentalmeansinfluiddynamics,therobustandeasy-to-implementstructured-lighttechniqueforcomputerscienceapplications,digitalholographyforperformingmicro-tonanoscalemeasurements,andgrating,interferometry,andfringeprojectiontechniquesforpreciselymeasuringdynamicallydeformablenaturalobjects.Thebookgoesontodescribetechniquesthatdonotrequiretriangulationtorecovera3Dshape,includingtime-of-flighttechniquesanduniaxial3Dshapemeasurement,aswellas3Dmeasurementtechniquesthatarenotrestrictedtosurfacecapture,suchas3Dultrasound,opticalcoherencetomography,and3Dendoscopy.Thebookalsoexploreshownovel3Dimagingtechniquesarebeingappliedinthepromisingfieldofbiometrics―whichmayproveessentialtosecurityandpublicsafety.Writtenbykeyplayersinthefieldandinventorsofimportantimagingtechnologies,thisauthoritative,state-of-the-arthandbookhelpsyouunderstandthecoreof3Dimagingtechnologyandchoosetheproper3Dimagingtechniqueforyourneeds.Foreachtechnique,thebookprovidesitsmathematicalfoundations,summarizesitssuccessfulapplications,anddiscussesitslimitations.
2023/8/18 7:11:34 17.61MB Handbook 3D machine vision
1
共 41 条记录 首页 上一页 下一页 尾页
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡