1 | local function func0(param) |
由于 f1 和 f2 是闭包,它们可以访问并修改同一个 param 变量,即使在 func0 执行完毕之后。每次调用这些闭包时,它们都会记住 param 的当前值,并在下一次调用时继续修改它。
在Lua中,每个闭包可以有一个upvalue值,或者多个闭包共享一个upvalue数值param。
重要的是要理解,upvalue是共享的,并且是在闭包创建时捕获的。这意味着,对于由func0返回的每一个闭包(即f1和f2),它们共享相同的upvalue引用,即它们对param的引用是相同的。因此,当f1或f2修改param的值时,这个改变对其他闭包以及外部函数FunctionMain中可见的param都是可见的。
1 | function FunctionMain(param) |
前两天收到阿里云的客服通知,现在有99一年的服务器,续费也是99/年(aliyun.com)感兴趣的朋友可以去了解下,机型是2核。
乘着这个东风我就顺带着将博客从静态托管的服务器搬迁到ecs上,本文记录下如何将hexo生成工具部署到服务器,实现前端hexo静态站,后端CodeServer编辑发布。
具体选型也不是很重要,理论上只要支持 宝塔(https://www.bt.cn/) 插件就行。
如果不清楚宝塔是什么,下面是摘录官网的一段描述:
1 | 宝塔Linux面板是提升运维效率的服务器管理软件,支持一键LAMP/LNMP/集群/监控/网站/FTP/数据库/JAVA等100多项服务器管理功能。 |
这边我用机型是 CenterOS7.x ,如果怕麻烦可以直接选用我这个机型。
1 | yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec |
安装一路确认就行,安装完毕会给登录信息,包括面板地址,帐号密码等。注意下开放的端口。初次安装会随机出一个外网登录面板的端口,需要将这个端口开放一下,在阿里云的安全组打开指定端口就行。
在宝塔的商店面板中找到CodeServer并安装,点设置将服务器打开。
安全设置中有需要开放的端口,与访问信息。注意甄别。
ssh登录服务器,先安装下面两个:
yum install npm
npm install hexo-cli -g
通过下面指令可以创建一个名为xxxx的hexo工作区,这部分可以参考 (https://hexo.io)
创建hexo工作区hexo init xxxx
登录前端宝塔面板,只需要安装nginx组件。
按照之前配置的路径指定即可。
在ssl一栏用 Let’s Encrypt ,可以获取一个免费的证书,点一下就行。
本篇没有任何难度,基本上都是面板上点点,指令输入下。需要花费的时间大概在10分钟左右,满足随意开网页随时能写的需求。
]]>在Google浏览器上打开CodeServer,也就是Web版本的VisualStudioCode 可以像独立程度一样在桌面运行。这个时候已经很难感受到底是Web应用还是一个本地应用了。现在我们给他添加上MarkDown的预览功能吧。
按照下图安装
安装后使用快捷键 Ctrl + Shift + V
即可打开预览界面
如果还需要在编辑器里查看图片资源,可以添加Image preview
插件,点击图像资源预览。
首先说下是否有必要进行公安备案,如果提供互联网服务是必须要备案的,像博客一类不提供任何服务的备案是不收费的,流程也不复杂。 登录全国互联网安全管理服务平台(https://beian.mps.gov.cn/)注册账户进行下面的备案流程,时间大概在10分钟左右即可处理完毕。
首先要在公安备案之前要确保你有了已经备案过的域名,域名备案可以在阿里云找到域名的备案服务会有专门的客服与你对接。
如果域名备案都处理好了,可以在 https://beian.mps.gov.cn 注册个人账户,进入后续流程。如果是走公就是公司主体我们这边不进行讨论。
没有什么额外复杂的东西要填写,都是主体填写过的资料,域名证书如何获取与阿里云的服务器信息可以参考下方说明。
填写网络接入服务商信息
若您的备案所需服务器是在阿里云购买,办理公安联网备案的域名是通过阿里云在工信部备案,阿里云信息如下。
网络接入服务商名称:阿里云计算有限公司
网络接入商所属区域:浙江省杭州市余杭区
接入方式:租赁虚拟空间
接入服务商电话:95187
接入服务商组织机构代码/接入商编码:673959654
填写域名注册服务商信息
若您办理公安联网备案的域名是通过阿里云注册,阿里云信息如下。 如需下载域名证书,请参见域名证书。
域名注册服务商名称:阿里云计算有限公司(原万网)
域名注册服务商所属区域:浙江省杭州市余杭区
域名注册服务商电话:010-65985888
记录下此刻的一些冒泡灵感,今后一段时间大概会围绕这个主题发散的写一点东西。
1 | 1. 小游戏教学主题,一个贯穿的主线,做多个点的发散 |
暂时就想到这些后面再想到往后追加吧。
]]>制作一个隐私说明页,用于appstore审核
This software respects and protects the personal privacy of all service users. In order to provide you with more accurate and personalized services, this software will use and disclose your personal information in accordance with the provisions of this privacy policy. However, this software will treat this information with a high degree of diligence and prudence. Except as otherwise provided in this privacy policy, this software will not disclose or provide this information to third parties without your prior permission. This software will update this privacy policy from time to time. When you agree to this software service use agreement, you are deemed to have agreed to the entire content of this privacy policy. This privacy policy is an integral part of this software service use agreement.
a) When you use this software network service, this software automatically receives and records the information on your mobile phone, including but not limited to your health data, language used, access date and time, software and hardware characteristics information and your needs Web records and other data;
a) Information will only be stored locally and will not be collected and stored
a) This software will not disclose your information to untrusted third parties.
b) Disclosure to third parties or administrative or judicial institutions in accordance with relevant provisions of the law, or the requirements of administrative or judicial institutions;
c) If you violate relevant Chinese laws, regulations or relevant rules, you need to disclose to a third party;
The information and data about you collected by this software will be stored in this software
a) When using this software network service to conduct online transactions, you will inevitably disclose your personal information, such as contact information or postal address, to the counterparty or potential counterparty. Please properly protect your personal information and only provide it to others when necessary. If you find that your personal information is leaked, please contact the customer service of the software immediately so that the software can take corresponding measures.
]]>svn: E155032: The pristine text with checksum xxx
如果你项目中没有 sqlite3.exe 工具,点下面链接下载一个。下载链接sqlite3.exe
1 | Precompiled Binaries for Windows |
先说下本篇博问的起因,在我的群里总有一些朋友在问,关于旋转,空间点判定等问题,关于这些程序实现上的问题,看完本篇后你会发现要解决也很简单。
本篇关键字:点乘 叉乘 弧度 角度 sin cos asin atan atan2
这张图可以记一下,简单明了,仔细看下图里有画垂直与Y轴与X轴的红线。
这边是diffuse的计算方式,这里用到的dot,判定法线是否与光源反射的方向同向。
如果两者同向反射光强度最高,反之则变暗。
这段代码直接通过dot判定是否物体在我们的前或后。
1 | var forward = transform.TransformDirection(Vector3.forward); |
这个概念我常常见有人搞混,口语化描述弧度或者角度,我们都称之为度,所以经常会弄错。
有个简单的记忆方式:
1 | 一般unity中对Eular Angle进行操作的api用的都是角度而非弧度。 |
角度转方向向量
1 | public Vector3 OriToVec(float orientation) |
我这边用的是lua演示的,数学库运算结果都一样。
1 | math.deg(math.asin(math.sin(math.rad(30)))) --result:30 |
Mathf.Atan()返回的值的范围是[-π/2,π/2],Mathf.Atan2()返回的值的范围是[-π,π]。
1 | math.deg(math.atan2(3,4)) --result: 36.869897645844 |
前人已经实现了很多数学函数库,只要把数学当作工具使用就行了。了解这个”工具“的性能,以及如何运用。那么你一定会做的很好。
]]>下面简单介绍下此Demo, 该demo是我的小试验田,主要是位置同步相关。感兴趣的可以follow一下。
1 | PlayerSelf.cs 模拟主角协议收发以及位移处理 |
这里讲一下我的思路,玩家每次收到的Pack结构如下:position是此刻当前物体处在位置,angle为运动方向,speed为0则物体进入idle。
1 | public class PlayerStatePack |
下面是模拟服务端延迟的实现,fluctuation用来模拟网络抖动:
currentTime = Time.time + Ping / 1000f * 2 + Random.Range(-fluctuation * 2/1000f , fluctuation * 2/1000f );
1 | void Update() |
客户端接收消息实现如下:通过ReceivePack函数订阅模拟服务器下发的Pack, 在该函数内做一个向量的减法,获取当前客户端所处与服务器同步过来的位置之间的误差,
有了此向量,那后面就可以通过插值逐渐修正到一个趋近正确的位置,一定程度上抹平网络波动引起的误差。
在 ApplyPoint 函数我做了一个当前误差的差值与角度差值,这样效果会好一些。
1 | public void OnMove(float passTime,float step,Vector3 pos,float angle) |
还有其他方式优化表现,对我来说目前这种方式表现已经足够便没有尝试,下面贴了条链接其中有讲到 立方样条插值,这种方式常见于各种导航软件比较复杂。如果是
赛车游戏我倒是非常推荐用这种预测模式降低网络抖动造成的拉扯现象。
先列一下几种位置同步的【条件】:
1 | 角度是否变更 |
在固定的周期内会检测一次两个条件是否超出一定的阀值,如果超过定量则在该周期内同步一次。服务器则根据当前同步的角度预测计算帧当前角色可能的位置。
如果是这种做法,当前移动速度为6m/s :
1 | 客户端刷新周期250ms,延迟为200ms,服务器得到当位置的最大误差为: (0.25s + 0.2s) * 6m = 2.7m 每秒4个包 |
以此类推,稍微优化一下也用不了那么多包,如果【条件】没有变更的话是不需要持续在周期内同步。也就变成了每帧判定【条件】是否变更,如果没有变更则无需同步,
否则走默认的周期检测,检测周期也就可以改为1s同步一次当前位置。
在此基础上可以知道延迟固定的最大误差为 0.2s * 6m = 1.2m ,那么现在基于此应该去尽量少的发送数据包,也尽量少降低误差。
如果【条件】改变的频繁会大幅增加发包的数量,甚至可能每帧都产生一个包。如果玩家在原地绕圈的时候.
此时增加【条件】的冗余可以减少当前发包的数量,如 增加 角度/距离 变更的判定范围。
实际上这样做的效果并不好,原因是【条件】太容易满足。
前面有说到服务器预测当前物体,在计算帧的坐标是基于 运动朝向 + 物体坐标
那么在我们的检测代码中可以做两次计算:
先预测服务器得到的当前物体位置 : 上次同步的坐标 + 运动方向 * 同步结束后累计的时间
计算当前物体实际距离与 预测服务器得到的当前物体位置 之间的距离
如果当前位置与服务器预测的位置误差控制在一定的范围内则不需要同步反之立即同步一次;
这样的好处是误差可以控制在一定的范围内并且尽量的少发送同步包;比如误差控制在0.1m范围,如果发送的包超量再适当的增加此范围。
这两天还在调试 尽量取一个比较折中的方案,如果实在达不到预期再考虑 双端同步时间种 基于此各自做运动状态的计算。
撞墙后通过代码使人物转向,不要降低运动速度即可。
1 | 切换网页内嵌的css/js/font 源至国内的cdn |
国内的云服务器价格高带宽低,还有就是国内备案办手续时间挺久来来回回审核资料我也怕麻烦,这也是我一度觉得没必要迁入的原因之一。
就在最近 githubhub 的 page 服务终于迎来了社会的毒打,国内大部分品牌的宽带都没办法访问,移动网络还是偶尔可以。已经屏蔽的很彻底了。
我还是下决心花点时间将站点移动到国内 ,下面说说我迁站遇到的事儿。
个人博客不商用就是记录一些日常的积累和一些偶尔的想法,所以呢,我想租一个尽量便宜的主机。
同事给介绍了一个虚拟云主机,说白了就是共享主机。如果不了解什么是共享主机的我举个栗子。租房子的 整租 和 合租的概念 你就明白了。
最近做活动 3 年 600+ RMB 。已经很便宜了,缺点也有只能只能ftp操作,没提供ssh,也只有php环境,基本上就是和github的page一个配置。
对于目前做静态博客的人来说是比较友好的,如果不是 那还是老老实实买其他类型的吧。
备案的时候要举着身份证校验身份,非上海本地人要本市居住证。推荐上海这边管局审核,原因自然是上海这边效率高了,我大概4-5天审核好了。
备案之前如果你有域名的话要提前实名制域名。
不知道是否只有共享主机需要这样配置,其他的我也没有在阿里云上实践过。好处也有一点 可以开一个免费的https。证书是免费的
哦对了,cdn是阿里云单独收费的服务 …
在网站下面要把备案号贴出来,对 就像我现在这样。如果有时间可以再做一个公安备案。获得一个公安备案的logo,说实话还挺好看 。
1 | <a href="http://beian.miit.gov.cn/" target="_blank">沪ICP备0000000号</a> |
关注此插件已经有一段时间了,最早在2018就有preview版本了。但直到2019.7.15日 Addressable(1.1.5) 才正式发布第一个正式版。未来它会成为UNITY的内置标准组件,就像之前我介绍过的 IMGUI:UNITY的新UI系统 一样,目前该系统在UNITY2019的UNTY上已经成了标配组件。
从中我也发现了UNITY更新内置功能的规律。 1.放到preview给程序员们试用收集反馈 2.preview迭代后转正式 3.一段时间的正式版后转为内置组建。 那未来要预测UNITY在下版本的功能我们看preview列表中来自 Unity Technologies 的功能就行了.
写本章的主要目的是记录这两天遇到bug的体验。
Addressable 2019.8.28 更新到1.1.10版本,也就是本章使用的最新版本。本篇所使用的Unity版本2019.3.f1 如果你也想测试请注意本文的时效性。
我写了这么一段代码用来测试不用callback 而直接获取实时加载进度与结果。
1 | private static string loadPath = string.Empty; |
结果我发现我第一次点击test按钮 operationHandle.Status 并不会返回错误信息他返回的是一个None状态,导致后面的代码直接崩溃。
紧接着第二次点击test按钮,变得正常了打印 load failed ,并且 operationHandle.Status 为 failed 。
就这个问题我查了一个晚上,终于给搞明白了 。Addressables 直接加载文件,内部会校验自身是否初始化完毕如果没有初始化 那就执行一次初始化 在进行资源加载作业。
不负责任的猜想是开发这个插件的人觉得 Addressables 同步加载不优雅,直接给 Addressables.Initialize 函数给oabsolute,
改为了Addressables.InitializeSync 接口(非同步的初始化接口)。
现在问题来了,Addressables.InitializeSync 是非同步的,后面的加载函数肯定在 Addressables 还没初始化完毕的情况下调用,出现不可预知的错误。
如何解决:1. 显式初始化 2. 改代码手动添加加载KeyCache
第一种方案直接等待初始化完毕再进行加载处理
1 | IEnumerator loadRes() |
第二种方案这里我说下思路
Getting started with Addressable Assets
The Addressable Asset System 正式版应用(一)
学习Unity新出资源管理系统-Addressable Asset
GitHub Unity-Technologies/Addressables-Sample
找了下 Stackoverflow 发现一个可用的方案:原文点这里
If it’s caused by using Microsoft Account instead of Local Account to log in your Windows, the solution is in the SO link below. It’s just difficult to find it because it doesn’t talk exactly about TortoiseSVN, but the Subversion library which is under the hood of TortoiseSVN:
In SVN how do I override automatic Windows domain authentication
From the answer:
In “%AppData%\Subversion\servers” add into [groups] this line:
yoursvnserver_com = *.yoursvnserver.com
In the same file later add this group:
[yoursvnserver_com]
http-auth-types=basic;digest
我关注类似MVVM的UI框架已经很久了,从2019.1发布的功能列表中我终于看到了非常想要的功能库。那就是UI Elements.
我在2016年也写过类似框架介绍,感兴趣的话可以看一下细说PreGUI框架设计思路-蛮牛网。
与PreGUI的设计思路类似,但是官方出品质量肯定上去不止一个台阶。另外配有完善的Profile工具。让你可以清楚的看到UI的布局细节。
截止到今日,IMGUI还是作为辅助UI系统在Unity中使用【编辑器】,相信过不了多久他就会转正甚至取代目前的UGUI,所以我们现在早点了解也好未来可以快速上手。好了下面开始正文 :)
这里就不上图了。简单描述下 rootVisualElement,他就是我们所有UI的根节点。如果你写过HTML 那么你肯定可以轻易地的
可以轻易地的过渡到现在的写法上,理解上亦是如此。
但下面的代码里,代码我们先获取到了UI的根节点,跟然后创建各种元素,将其添加进我们的根节点上。至此我们不需要加上额外代码,即可渲染控件,就如同我们在运行时里使用UGUI做的一样。
这里有一个小技巧,像HTML一样我们可以通过ID来寻找我们的控件。所以在创建组件的同时,如果考虑到我们后续需要去动态寻找该组件,那么我们将其设置一个name,并且通过name来寻找。就像下面做的这样。var lable =rootVisualElement.Q
⚠️注意:.Q 查询函数为所有visual elements的扩展函数,也就意味着所有的元素都能搜索自己结构下的节点。
在这里你可以给控件添加回调函数,在该函数中你甚至可以获取触发当前回调的来源(每个控件都有callback)。就像下面做这样var slider = evt.target as SliderInt;
1 | void OnEnable() |
看图~
当然我们想要的更多,你同样可以通过样式文件与布局文件来渲染窗口。这才是我们最终的目的,什么让我们来看一下范例吧。
⚠️注意:我们读取之后的类型分别为 VisualTreeAsset 与 StyleSheet 。
读取之后直接
1 | VisualElement m_RootElement; |
使用CloneTree API可以创建读取出来的结构。并且将当前节点作为root的子节点。
1 | m_ModulesVisualTree.CloneTree(root); |
暂时我没有找到事件映射或者绑定的代码。也有可能是这部分的API没有开放出来。暂时来看IMGUI的完善进度也比较快,就算现在没有事件映射,也可以等等。毕竟现在还没有过preview阶段。不过现在已经看起来像那么一回事了,相信用上它的一天很快会到的。
添加高亮与提示(提示有限并不能很好的支持)
]]>最近经常会需要临时计算某个文件md5的需求。然后找了下相关命令在此记录下。
MAC:
1 | md5 you-file-full-path |
powershell
1 | get-filehash you-file-full-path -algorithm md5 |
本篇记录一些在Profile APK过程中可能遇到的一些问题。当然我也查了好一会儿。在这里做一下记录。
了解下 JIT 当然这不是C#或者Java里的JIT .
JIT的想法很简单:库存是资源浪费。JIT库存系统认为,库存带来了隐含的成本,因此高效率的企业应该不存在库存。公司需要采取一系列新的管理办法,进行变革。需要采取统计学、工业工程学、生产管理和行为科学中的管理办法。及时库存逻辑阐述了库存的内涵以及与管理的关系。库存会带来成本以及浪费,而不是增加或储存价值,这与传统会计学不同。这不是说,及时系统不需要对生产好的商品进行储存。而是鼓励企业逐步消除库存,以便削减生产流程中的成本。其次,在管理中逐渐适应“零库存”的状态。库存会带来很多附加成本,例如需要建立新的仓库、需要更新设备、减少流程的可变性、缺乏工人和设备灵活性、以及影响产量等。简单来说,及时制度主要的核心是“让正确的物资,在正确的时间,流动到正确的地方,数量是刚刚好的数量。”
在及时制度的诞生初期,很多产品的日常运输还是用自行车,当生产规模加大时,就需要汽车和卡车. 庫蘇馬諾在1994提出了此系統在交通阻塞和石化燃料的使用下會產生及有可能產生的弊端. 而這些弊端這違反了及時制度制訂的三條減少浪費的原則:
時間 - 在交通阻塞中所浪費的時間
庫存 - 在交通阻塞中滯留的產品
廢棄物 - 在交通阻塞中, 無法移動的狀態下, 燃料仍持續的被消耗
影响价格
及时系统提出,库存让价格变化性大,因为库存让企业需要提前根据产量,采购原材料,原材料的价格又会有波动,因此提高了价格变化性。如果原材料价格提高,库存成本也提高。
质量波动
及时制度提出,进口零件的质量一般稳定,如果不稳定的话,企业就会增加成本。企业一般会与固定的供应商合作,降低原材料的质量波动和价格。
需求波动
卡马克 (1989) 提出,相对稳定的需求的重要性是,帮助保证效率、资本利用率。卡马克提出,如果需求不稳定,及时系统就会带来很高的资本成本。
供应稳定
美国1992年的铁路工人罢工引起了通用电气公司裁掉了7.5万名员工,因为公司的产品供应不出去。
JIT实施方法
限制理論(Theory of Constraints,TOC)是由以色列學者伊利雅胡·高德拉特所發展出來的一種全方面的管理哲學,主張一個複雜的系統隱含著簡單化。即使在任何時間,一個複雜的系統可能是由成千上萬人和一系列設備所組成。但是只有非常少的變數或許只有一個,稱為限制,它會限制(或阻礙)此系統達到更高的目標。
TOC的思考程序可協助答覆專注於改善時的主要問題:
什麼要改變?
要改變成什麼?
如何造成改變?
有時,另外兩個問題也會被列為思考程序:
為什麼要改變?
如何保持持續改善的過程(英语:Process of ongoing improvement-POOGI)?
TOC主張任何組織或企業成立之時必然有一目標,但同時也存在著許多限制阻礙組織或企業達成這個目標。因此為了達成其更高的績效,就必須打破這些限制,做到持續的改進。
中文wiki内容有限下面是英文内容:
The theory of constraints (TOC) is a management paradigm that views any manageable system as being limited in achieving more of its goals by a very small number of constraints. There is always at least one constraint, and TOC uses a focusing process to identify the constraint and restructure the rest of the organization around it. TOC adopts the common idiom “a chain is no stronger than its weakest link”. This means that processes, organizations, etc., are vulnerable because the weakest person or part can always damage or break them or at least adversely affect the outcome.
Theory of constraints is based on the premise that the rate of goal achievement by a goal-oriented system (i.e., the system’s throughput) is limited by at least one constraint.
The argument by reductio ad absurdum is as follows: If there was nothing preventing a system from achieving higher throughput (i.e., more goal units in a unit of time), its throughput would be infinite — which is impossible in a real-life system.
Only by increasing flow through the constraint can overall throughput be increased.[1]
Assuming the goal of a system has been articulated and its measurements defined, the steps are:
Identify the system’s constraint(s).
Decide how to exploit the system’s constraint(s).
Subordinate everything else to the above decision(s).
Alleviate the system’s constraint(s).
Warning! If in the previous steps a constraint has been broken, go back to step 1, but do not allow inertia to cause a system’s constraint.[4]
The goal of a commercial organization is: “Make more money now and in the future”,[5] and its measurements are given by throughput accounting as: throughput, inventory, and operating expenses.
The five focusing steps aim to ensure ongoing improvement efforts are centered on the organization’s constraint(s). In the TOC literature, this is referred to as the process of ongoing improvement (POOGI).
These focusing steps are the key steps to developing the specific applications mentioned below.
A constraint is anything that prevents the system from achieving its goal. There are many ways that constraints can show up, but a core principle within TOC is that there are not tens or hundreds of constraints. There is at least one, but at most only a few in any given system. Constraints can be internal or external to the system. An internal constraint is in evidence when the market demands more from the system than it can deliver. If this is the case, then the focus of the organization should be on discovering that constraint and following the five focusing steps to open it up (and potentially remove it). An external constraint exists when the system can produce more than the market will bear. If this is the case, then the organization should focus on mechanisms to create more demand for its products or services.
Equipment: The way equipment is currently used limits the ability of the system to produce more salable goods/services.
People: Lack of skilled people limits the system. Mental models held by people can cause behaviour that becomes a constraint.
Policy: A written or unwritten policy prevents the system from making more.
The concept of the constraint in Theory of Constraints is analogous to but differs from the constraint that shows up in mathematical optimization. In TOC, the constraint is used as a focusing mechanism for management of the system. In optimization, the constraint is written into the mathematical expressions to limit the scope of the solution (X can be no greater than 5).
Please note: organizations have many problems with equipment, people, policies, etc. (A breakdown is just that – a breakdown – and is not a constraint in the true sense of the TOC concept). The constraint is the limiting factor that is preventing the organization from getting more throughput (typically, revenue through sales) even when nothing goes wrong.
If a constraint’s throughput capacity is elevated to the point where it is no longer the system’s limiting factor, this is said to “break” the constraint. The limiting factor is now some other part of the system, or may be external to the system (an external constraint). This is not to be confused with a breakdown.
Buffers are used throughout the theory of constraints. They often result as part of the exploit and subordinate steps of the five focusing steps. Buffers are placed before the governing constraint, thus ensuring that the constraint is never starved. Buffers are also placed behind the constraint to prevent downstream failure from blocking the constraint’s output. Buffers used in this way protect the constraint from variations in the rest of the system and should allow for normal variation of processing time and the occasional upset (Murphy) before and behind the constraint.
Buffers can be a bank of physical objects before a work center, waiting to be processed by that work center. Buffers ultimately buy you time, as in the time before work reaches the constraint and are often verbalized as time buffers. There should always be enough (but not excessive) work in the time queue before the constraint and adequate offloading space behind the constraint.
Buffers are not the small queue of work that sits before every work center in a Kanban system although it is similar if you regard the assembly line as the governing constraint. A prerequisite in the theory is that with one constraint in the system, all other parts of the system must have sufficient capacity to keep up with the work at the constraint and to catch up if time was lost. In a balanced line, as espoused by Kanban, when one work center goes down for a period longer than the buffer allows, then the entire system must wait until that work center is restored. In a TOC system, the only situation where work is in danger is if the constraint is unable to process (either due to malfunction, sickness or a “hole” in the buffer – if something goes wrong that the time buffer can not protect).
Buffer management, therefore, represents a crucial attribute of the theory of constraints. There are many ways to apply buffers, but the most often used is a visual system of designating the buffer in three colors: green (okay), yellow (caution) and red (action required). Creating this kind of visibility enables the system as a whole to align and thus subordinate to the need of the constraint in a holistic manner. This can also be done daily in a central operations room that is accessible to everybody.
There are four primary types of plants in the TOC lexicon. Draw the flow of material from the bottom of a page to the top, and you get the four types. They specify the general flow of materials through a system, and also provide some hints about where to look for typical problems. This type of analysis is known as VATI analysis[6] as it uses the bottom-up shapes of the letters V, A, T, and I to describe the types of plants. The four types can be combined in many ways in larger facilities, e.g. “an A plant feeding a V plant”.
V-plant: The general flow of material is one-to-many, such as a plant that takes one raw material and can make many final products. Classic examples are meat rendering plants or a steel manufacturer. The primary problem in V-plants is “robbing,” where one operation (A) immediately after a diverging point “steals” materials meant for the other operation (B). Once the material has been processed by A, it cannot come back and be run through B without significant rework.
A-plant: The general flow of material is many-to-one, such as in a plant where many sub-assemblies converge for a final assembly. The primary problem in A-plants is in synchronizing the converging lines so that each supplies the final assembly point at the right time.
T-plant: The general flow is that of an I-plant (or has multiple lines), which then splits into many assemblies (many-to-many). Most manufactured parts are used in multiple assemblies and nearly all assemblies use multiple parts. Customized devices, such as computers, are good examples. T-plants suffer from both synchronization problems of A-plants (parts aren’t all available for an assembly) and the robbing problems of V-plants (one assembly steals parts that could have been used in another).
I-plant: Material flows in a sequence, such as in an assembly line. The primary work is done in a straight sequence of events (one-to-one). The constraint is the slowest operation.
From the above list, one can deduce that for non-material systems one could draw the flow of work or the flow of processes, instead of physical flows, and arrive at similar basic V, A, T, or I structures. A project, for example, is an A-shaped sequence of work, culminating in a delivered product (i.e., the intended outcome of the project).
甘特图我推荐用下面这个,平时我做计划几乎都离不开Omniplan,它支持导出Project格式,同时支持任务排期跳过节假日等。
]]>本篇是给一个小朋友看的,原话是这样的:“用VisualStudio Code 看不了Markdown文件 。” 那么按照本篇操作,你将可以方便的在VsCode中预览Markdown文件。
安装完毕之后打开 .md
文件。就可以使用preview功能了。