城市天际线下载

不同角度的软件工程 (Software Engineering in different perspectives)

In the last few months, I have been exploring and experiencing (a.k.a playing) Cities: Skylines. For those who are not aware, Cities: Skyline is a simulated city-building video game. Although this game focuses on city planning, I found it interestingly sharing similar problems to what we deal with in Software Engineering.

在过去的几个月中,我一直在探索和体验(又称“玩耍”)“ 城市:天际线” 。 对于那些不知道的人,《 城市:天际线》是一款模拟城市建筑的视频游戏。 尽管该游戏专注于城市规划,但我发现它有趣地与我们在软件工程中遇到的问题共享相似的问题。

In this article, we would be looking at Traffic, the similarities in its impacts, and approaches to solve the problems in both City Planning and Software Engineering. These problems arise due to handling high load while having resource constraints.

在本文中,我们将研究流量,其影响的相似性以及解决城市规划和软件工程中的问题的方法。 这些问题是由于在具有资源限制的同时处理高负载而产生的。

Let me show you how. But, please bear in mind that my knowledge with city planning is limited to exposure to the game and personal casual life experiences.

让我告诉你怎么做。 但是,请记住,我对 城市规划的 知识 仅限于接触游戏和个人休闲生活。

交通 (Traffic)

Traffic unarguably is one of the biggest issues in Cities: Skylines or any cities in the world. The longer the time to get from A to B, the less efficient things can be run in a city.

毫无疑问,交通是城市中最大的问题之一:天际线或世界上任何城市。 从A到B的时间越长,在城市中运行的效率越低。

Let’s take the Economy and Healthcare aspects as examples.

让我们以经济医疗保健方面为例。

对经济的影响 (Impacts on the Economy)

If traffic is bad, raw materials cannot be transported in time. This leads to goods that cannot be produced in time. Commercials do not have enough to sell. People do not have enough to buy and consume. The economy collapses.

如果交通不畅,原材料将无法及时运输。 这导致无法及时生产商品。 商业广告没有足够的销量。 人们没有足够的购买和消费。 经济崩溃。

People start leaving the city. POOFS, the city is gone.

人们开始离开这座城市。 POOFS,这座城市不见了。

对医疗保健的影响 (Impacts on Healthcare)

If traffic is bad, it takes longer for ambulances to travel from hospitals to patients and get back. With a limited number of ambulances, longer round trip time means fewer people can reach hospitals.

如果交通不畅,救护车需要更长的时间才能从医院运送到病人并返回。 由于救护车数量有限,往返时间较长,意味着到医院就医的人数会减少。

Imagine there are 10 ambulances in a hospital. If all of them are stuck in traffic jams, no patient would be treated in time.

想象一下,医院里有10辆救护车。 如果所有这些人都被塞在交通拥堵中,则不会及时治疗患者。

Or about deathcare, there are a limited number of hearses in each funeral company to transport the deads. If all of the hearses are stuck in traffic or take a long time to collect the dead, eventually, there would be enough dead bodies lying in buildings making the city unlivable.

关于死亡护理 ,每个fun仪公司都有数量有限的灵车来运送死者。 如果所有的灵车都堵在车里或花费很长时间来收集死者,那么最终,建筑物中就会有足够多的死者尸体,使这座城市无法居住。

People start leaving the city. POOFS, the city is gone.

人们开始离开这座城市。 POOFS,这座城市不见了。

软件工程中的流量问题 (Traffic problems in Software Engineering)

The same challenge applies to software applications too.

同样的挑战也适用于软件应用程序。

The higher the latency in network calls resulted in longer response time to end-users’ requests. Given a limited number of concurrent requests can be served, fewer requests can be handled, and the service would eventually reach denial-of-service (DoS).

网络呼叫的等待时间较长,导致对最终用户请求的响应时间更长。 如果可以处理有限数量的并发请求,则可以处理更少的请求,并且该服务最终将达到拒绝服务(DoS)。

解决交通问题 (Solving the traffic issues)

There is quite a number of patterns we could apply from Software Design into City Planning.

从软件设计到城市规划,我们可以应用许多模式。

But first, to solve traffic problems, we would first need to

但是首先,要解决交通问题,我们首先需要

  • Understand where traffic comes from了解流量来自何处
  • Identify hot spots识别热点
  • And then solve the problems然后解决问题

Let’s start!

开始吧!

流量来源 (The sources of traffic)

在城市规划中 (In city planning)

Traffic comes from people going to work or going for entertainment.

交通来自上班或娱乐的人们。

Traffic comes from trucks transporting raw materials to industrial zones, transporting goods from industrial zones to commercial zones.

交通来自将原材料运输到工业区,将货物从工业区运输到商业区的卡车。

Traffic comes from public services like healthcare, deathcare, firetrucks, police cars, …

交通来自医疗保健,死亡护理,救火车,警车等公共服务。

在软件工程中 (In software engineering)

Traffic comes from users requesting for webpages, APIs, videos, images, …

流量来自请求网页,API,视频,图像等的用户。

Traffic comes from analytics trackings.

流量来自分析跟踪。

In the context of microservices, besides traffic originated from end-users, there is a large amount of internal traffic happening due to communication between services.

在微服务的上下文中,除了源于最终用户的流量之外,由于服务之间的通信,还会发生大量内部流量

识别热点 (Identify hot spots)

I love making data-driven decisions.

我喜欢制定数据驱动型决策。

It is pretty awesome that Cities: Skylines provides a set of tools for that. You can get more tooling from the modding workshops too.

城市:天际线为此提供了一套工具,这真是太棒了。 您也可以从改装车间获得更多工具。

Red areas signifying bad traffic
红色区域表示交通不畅

Looking at the traffic analyzer, we would be able to identify the hot spots that need looking at. Most of the time, they would be industrial or commercial areas where a lot of trucks operating.

查看流量分析器,我们将能够确定需要查看的热点。 在大多数情况下,它们将是在许多卡车在运转的工业商业 区域

You can observe a lot of red areas around intersections, those are places vehicles making turns to their destinations. This means that, if there are a lot of vehicles going to the same destinations, making the same turns, traffic would be bad.

您可以在十字路口周围看到很多红色区域,这些区域是车辆驶向目的地的地方。 这意味着,如果有许多车辆前往相同的目的地,进行相同的转弯,那么交通将会很糟糕。

In software development

在软件开发中

Great toolings would also help make our lives easier.

出色的工具也将使我们的生活更轻松。

Example of application monitoring dashboard
应用程序监控仪表板示例

It is crucial to have your endpoints and system metrics monitored. Some of the common tools are SignalFx, Datadog, Prometheus, …

监视端点和系统指标至关重要。 一些常见的工具是SignalFx,Datadog,Prometheus等。

Monitoring would help to identify long-running requests or detect sudden spikes in traffic.

监视将有助于识别长时间运行的请求或检测流量突然增加。

Now let’s talk about some of the ways to solve the traffic problems.

现在让我们讨论一些解决交通问题的方法。

公共交通与批量请求 (Public transport vs. Batch requests)

A bus can transport around 30 people. A metro train can transport around 150 people.

一辆公共汽车可以运送大约30人。 地铁可运送约150人。

Without public transport, those 30–150 people using private vehicles would result in 15–50 times more traffic than a single bus or train.

如果没有公共交通工具,那30-150人使用私家车将导致的交通量是单辆巴士或火车的15-50倍

In software engineering, a similar strategy is applied by batching network requests in larger batch requests. Each request has its own request headers and response headers. Batching requests help minimize bandwidth consumption thanks to avoiding the headers of each individual request.

在软件工程中 ,通过在较大的批处理请求中批处理网络请求来应用类似的策略。 每个请求都有其自己的请求标头和响应标头。 批处理请求避免了每个单独请求的标头,从而有助于最大程度地减少带宽消耗。

It would also help significantly reduce the number of IO calls, i.e. reduce latencies when communicating between services.

这也将有助于大大减少IO调用的数量,即减少服务之间进行通信时的等待时间。

划分高流量区域与分片 (Dividing high traffic zones vs. Sharding)

As explained above, industrial zones are major sources of traffic due to several reasons

如上所述,由于多种原因,工业区是主要的交通来源

  • Trucks delivering raw materials to factories卡车运送原料到工厂
  • Trucks delivering produced goods from factories to commercial zones卡车将生产的货物从工厂运送到商业区
  • Private vehicles of people coming for work上班族的私家车
  • Public services (especially firetrucks as factories being highly prone to fire)公共服务(尤其是因为工厂极易起火的救火车)
  • And, trucks are significantly bigger than normal vehicles, occupy more space when queuing, and take a longer time to turn or accelerate而且,卡车比普通车辆大得多,排队时占用更多空间,而且转弯或加速所需的时间更长

Therefore, large industrial zones easily cause traffic jams on the main roads in-and-out the areas since even 5-lane-road would not be sufficient to handle such traffic.

因此,大型工业区很容易在该区域内外的主要道路上造成交通拥堵,因为即使是5车道的道路也不足以处理此类交通。

One of the approaches to this problem is “Sharding”.

其中一个办法解决这个问题的是“ 拆分 ”。

Sharding” means dividing large industrial zones into small distributed industrial zones. This would significantly reduce the load on the main roads leading into or leading out of the zones.

拆分 ”是指将大型工业区分成小的分布式工业区。 这将显着减少通往区域的主要道路的负荷。

在软件工程中 (In software engineering)

Sharding is used to divide giant data sets into smaller distributed data sets. It’s a popular technique in database optimization.

拆分是用来划分巨大的数据集分成更小的分布式数据集。 这是数据库优化中的流行技术。

组件的专用资源和路由 (Dedicated resources and routings for components)

Let’s revisit the ambulance example. The last thing you would like to is for AMBULANCES to be stuck in traffic with TRUCKS as they are serving different “stakeholders”. Ambulances serve residentials, trucks do not.

让我们回顾一下救护车的例子。 您最后要做的就是让AMBULANCESTRUCKS保持联系,因为它们服务于不同的“利益相关者”。 救护车服务于住宅,卡车则不服务。

It seems to be common sense to mix between residential areas and commercials areas. However, traffic would easily be mixed up between the two.

在住宅区和商业区之间混合似乎是常识。 但是,流量很容易在两者之间混合。

It is more efficient to split residential, commercial, and industrial zones to its own areas. Each of these zones would need dedicated roads leading from highways to them.

将住宅,商业和工业区划分为自己的区域效率更高。 这些区域中的每个区域都需要从高速公路通向它们的专用道路

在软件工程中 (In software engineering)

Similarly in software, it is not desirable for traffic from analytics collectors or asset serving to affect core Web/API servers.

类似地,在软件中,来自分析收集器的流量或资产服务影响核心Web / API服务器也是不希望的。

Therefore, in practices, different domains are used for each of them to maximize browser concurrency since browsers limit concurrency per domain.

因此,在实践中,由于浏览器限制每个域的并发性,因此对每个使用不同的域以最大化浏览器的并发性。

Different sets of servers are also used for each of the purposes. Web/API servers would be separated from Analytics collection servers. Assets would usually utilize CDN to optimize both delivery speed and traffic.

每种目的还可以使用不同组的服务器 。 Web / API服务器将与Analytics收集服务器分开。 资产通常会利用CDN来优化投放速度和流量。

结论 (Conclusion)

Those are just some of the aspects that I find interesting similar between City planning and Software design. What do you think about it? I would like to hear your thoughts.

这些只是我发现城市规划和软件设计之间相似的一些方面。 你怎么看待这件事? 我想听听你的想法。

Thanks for reading!

谢谢阅读!

翻译自: https://medium.com/swlh/cities-skylines-from-a-software-engineers-point-of-view-709d75229b86

城市天际线下载


http://www.taodudu.cc/news/show-5090453.html

相关文章:

  • WPS里如何去掉英文引号自动转换为中文引号?
  • Kali linux 学习笔记(三十五)无线渗透——WPS攻击 2020.3.13
  • 【安全牛学习笔记】 WPS
  • 怎样在WPS上实现代码语法高亮
  • 无线渗透(六)WPS、伪造AP
  • WDS、WPS及WIFI2.4/5G相关
  • 怎样在WPS上实现代码语法高亮(转)
  • 关于JAVA POI解析WPS docx文档中的table(复杂表格包含单元格横向,纵向的合并)
  • WPS和探针
  • linux的wps文件怎么看,wps文件扩展名,wps文件怎么打开?
  • 无线渗透_WPS攻击
  • 文件夹更改图标
  • Windows11修改文件夹图标的方法
  • Android10 Launcher3调整文件夹图标的默认布局
  • 修改默认文件夹的图标(使用注册表)
  • jbuilder9创建窗体程序简单实例
  • JBuilder快捷键 不全的请指教!
  • [转载]JBuilder2005单元测试体验之测试配置
  • JBuilder 无法启动的解决方法
  • Jbuilder 9.0光标错位问题
  • JBuilder 2007 Enterprise Edition 王者归来
  • 如何使用JBUILDER开发J2ME应用(转)
  • 图解Java开发工具JBuilder 9 0(三)
  • JBuilder快捷键
  • JBuilder
  • 图解Java开发工具JBuilder 9 0(一)
  • [转载]JBuilder2005创建开发文档之编写注释
  • [转载]用JBuilder9 开发Struts实例
  • JBuilder特点
  • 图解Java开发工具JBuilder 9 0(二)

城市天际线下载_从软件工程师的角度看城市天际线相关推荐

  1. java高级软件工程师面试_高级软件工程师的新面试问题

    java高级软件工程师面试 I'm putting together some practice interview questions for a friend who lost his job. ...

  2. 工程师必读书籍_最佳软件工程师必读书籍

    工程师必读书籍 以下是必读软件工程书籍的CodeBuild选择. 书籍根据其内容和描述进行分组. 相关书籍 对于每位软件工程师来说,这些Robert C. Martin和Gang of Four书籍都 ...

  3. 【校招】面试_华为_通用软件工程师_二面

    1 面试信息 面试形式:视频面试 面试时间:2020-03-25 11:30:00 AM 面试时长:40分钟 面试职位:软件技术开发部-通用软件工程师(无线网络产品线-通用软件开发工程师) 2 面试问 ...

  4. twitter软件资源_以软件工程师的身份在Twitter上找到工作[我的工作方式]

    twitter软件资源 这是关于我如何在Twitter上担任全职软件工程师的工作,经历的经历,准备的过程以及为什么最终决定加入该公司的故事. Click-clack-click-clack . 我的手 ...

  5. er图用什么软件_从软件开发生命周期看商业智能 BI 数据仓库建模

    关于商业智能 BI 的介绍面对不同的企业客户可以从很多不同的角度展开,比如从业务角度.管理角度.数据架构角度.IT 信息化建设角度.BI 实施方法论角度等,不同的视角可以帮助企业更加全面的了解商业智能 ...

  6. 如何确定autosar的版本_从工程师的角度看AUTOSAR

    引言: "软件定义汽车"的火热带动了工程师们对于汽车电子软件热烈地讨论.不曾想到,隐藏在控制器内部,默默地发挥着作用的汽车电子软件,如今备受瞩目.本人毕业到现在,一直在汽车行业做软 ...

  7. 【宅男福利】百度云下载不限速软件,电脑和看视频无广告软件

    百度云下载不限速软件链接: https://pan.baidu.com/s/13TMUtITclfpkcOnF3Sh8Rw 提取码: yxhk 电脑和看视频无广告软件链接: https://pan.b ...

  8. 《这就是软件工程师》- 每位软件工程师值的看的一本书,尤其是刚刚步入IT行业的年轻人

    文章目录 第一部分|行业地图 1.现实:为什么会有996? 1)行业处于特定的发展阶段 2)公司组织管理问题 2.进阶:软件工程师的四大台阶 1)新手阶段[执行力] 2)进阶阶段[设计能力] 3)高手 ...

  9. csp2020 j2民间数据下载_摊开母婴市场数据集看一看

    本文从数据分析的角度看一下母婴市场的一些数据.在手的数据集从天池上下载,关于国内淘宝母婴产品的销售情况,下载链接:https://tianchi.aliyun.com/dataset/dataDeta ...

最新文章

  1. 从信息瓶颈理论一瞥机器学习的“大一统理论”
  2. 陈序猿,你敢创业吗?怎么才算成功?
  3. 弱小无助!苹果或将出手救援屏幕供应商JDI
  4. oracle同义词性能,ORACLE同义词总结 - welcome to open life - OSCHINA - 中文开源技术交流社区...
  5. 【Docker系列】从头学起 Docker——docker run 命令详解
  6. 02 Jmonkey3.2.0+Nifty1.4.2实现GUI
  7. 橡胶垫片的特点与用途
  8. matlab计算器设计流程图_matlab计算器的设计.doc
  9. 移动开发——Java
  10. 为没有后缀名的文件设置默认打开方式——Notepad++
  11. ant jmeter 原理_Ant+Jmeter自动化接口测试
  12. VB.NET邮件群发纯htlm二维码
  13. 倒计时抢(数据分析)
  14. 修改EBS R12界面LOGO
  15. excel VBA自动化 - IF条件语句和FOR循环语句应用
  16. 暗黑起源服务器维护,暗黑起源官方网站
  17. SQL存储过程的递归调用
  18. linux 用户密码加密
  19. 苹果计算机又记录吗,苹果电脑肿么看历史记录
  20. C++入门教程:大白话讲解,新手基础篇(附源码及详解、视频课程资料推荐)

热门文章

  1. python 保存h5文件_将数据保存到h5
  2. 吴军的谷歌方法论|第012封信|一生的五件事
  3. 牛人的PENTAX单反之路_我是亲民_新浪博客
  4. Google Protocol Buffer(GPB)使用之完全解析三:如何使用GPB?
  5. 男性着装常识(男人珍藏篇)
  6. 一个非常好用而且通用的Audio dump工具
  7. 换新电脑如何一键迁移旧电脑数据
  8. Linux中文显示乱码问题解决方法 和 将英文提示换成中文提示
  9. goto+双指针运用示例
  10. Delphi : 分割字符串string,取出截取中间字符串