AnyLogic:根据三个资源的容量选择进入块的分布问题。
创始人
2024-08-22 15:00:43
0

该问题可以使用AnyLogic中的Process Modeling Library解决。下面给出代码示例:

  1. 建立3个资源(ResourcePool)并设置各自的容量(capacity)。
ResourcePool resource1 = new ResourcePool(this, "Resource 1");
resource1.setCapacity(3);

ResourcePool resource2 = new ResourcePool(this, "Resource 2");
resource2.setCapacity(2);

ResourcePool resource3 = new ResourcePool(this, "Resource 3");
resource3.setCapacity(1);
  1. 建立进入块(Enter)并将其与3个资源相连接。
Enter enter = new Enter(this);
enter.to(resource1).to(resource2).to(resource3);
  1. 给每个资源设置动态容量(dynamicCapacity),用于计算可用资源数量。
resource1.setDynamicCapacity(() -> resource1.getCapacity() - resource1.getSeized());
resource2.setDynamicCapacity(() -> resource2.getCapacity() - resource2.getSeized());
resource3.setDynamicCapacity(() -> resource3.getCapacity() - resource3.getSeized());
  1. 建立2个分布(Distribution),分别处理在3个资源未满足条件时进入块进入的概率。
Distribution dist1 = new Distribution(this, "Distribution 1");
Distribution dist2 = new Distribution(this, "Distribution 2");
  1. 设置2个分布的概率分布,其中一个分布依赖于资源1和资源2的容量,另一个分布依赖于资源3的容量。
dist1.add(0.3, () -> (resource1.getDynamicCapacity() < 1 || resource2.getDynamicCapacity() < 1));
dist1.add(0.7, () -> (resource1.getDynamicCapacity() >= 1 && resource2.getDynamicCapacity() >= 1));

dist2.add(0.5, () -> (resource3.getDynamicCapacity() < 1));
dist2.add(0.5, () -> (resource3.getDynamicCapacity

相关内容

热门资讯

透视专业!wepokerplu... 透视专业!wepokerplus辅助(透视)wpk透视是真的吗,教程教材(有挂攻略)-哔哩哔哩1、每...
WePOker有没有透视方法!... WePOker有没有透视方法!aapoker怎么设置提高好牌几率(透视)技巧-总是了解真的是有挂1、...
透视揭露!wepokerplu... 透视揭露!wepokerplus开挂(透视)wpk透视最怕三个东西,教程法子(有挂头条)-哔哩哔哩1...
hhpkoer辅助挂是真的吗!... hhpkoer辅助挂是真的吗!wepoker辅助透视软件(透视)方法-其实专业存在有挂在进入hhpk...
透视关于!hhpkoer辅助器... 透视关于!hhpkoer辅助器视频(透视)hhpoker为什么一直输,教程教材(有挂头条)-哔哩哔哩...
aapoker插件!cloud... aapoker插件!cloudpoker怎么开挂(透视)软件-真是科普是真的挂1、这是跨平台的clo...
透视科普!来玩德州破解器(透视... 透视科普!来玩德州破解器(透视)wepoker透视有用吗,教程学习(有挂助手)-哔哩哔哩1、不需要A...
hhpoker德州透视!pok... hhpoker德州透视!pokemmo手机脚本(透视)app-本来开挂真的是有挂1、完成pokemm...
透视教你!werplan透视挂... 您好,pokemmo辅助官网这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】...
佛手在线大菠萝技巧!werpl... 佛手在线大菠萝技巧!werplan开挂(透视)攻略-一直透视有挂1、佛手在线大菠萝技巧有没有辅助教程...