设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13222|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: O" \6 G- F* i6 k, x- O
) [# N) _  d' R9 q. c2 j
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。7 \. Z2 N8 D# k  T9 K1 B. p
- \) `! M9 B: S4 T$ k
begin P_read arriving- J' u" p$ V8 ]" J2 H) T
    while 1=1 do begin
. v1 W. F* t1 A; A% V        read A_tote from "data.txt" with delimiter "\n"
' L4 f9 _1 f. X& V' `3 _3 P; q% I& L$ `        read A_time from "data.txt" with delimiter "\n"
8 P# ]- w3 |0 E* a0 ^8 y        read A_leave from "data.txt" with delimiter "\n"( |$ p8 f+ R$ d8 V  ^  k
        read A_picks from "data.txt" with delimiter "\n": V& x( C; h/ \% Z
        set load type to A_tote
  ~9 ?3 v& d* C+ A( ~2 I        if A_tote="tote 1" then set A_induct to 1
$ f8 \% A3 P8 r$ F6 w, x) |% x' e        else if A_tote="tote 2" then set A_induct to 27 ~$ M6 j7 `8 u) ?5 d% R
            else set A_induct to 3    4 M: p$ }/ \, T
        set A_i to 0
8 X; w, M# r, ?0 T" b( B/ Q        clone 1 load to P_induction
5 g% P& K6 W$ W; B1 a. |( ^/ _        wait for A_time sec, r& s2 q; U3 ^7 v; T' Z$ k& ]* [
    end9 D: Z( c) e7 ^0 L1 m* z' J. H
end
# U. k( N% c6 ^* m2 ?( G% S
  d0 Z# A" M8 G, \. Ibegin P_induction arriving
* {2 u! c- O4 {$ G( c0 A: x    if A_induct=1 then clone 1 load to P_pick10 L$ l9 p# A7 [: |) U8 p8 \4 W8 N$ I
    else if A_induct=2 then clone 1 load to P_pick2# g8 E- P/ \+ ?& x% H" D  z
        else clone 1 load to P_pick3
& j' ?! }2 P! v, e# t- x5 K% Rend# m6 f6 Z+ f8 |4 E8 k) n: m- U5 C: u) D

# @& Y( k; R% \$ f' ?, M' P- Ebegin P_pick1 arriving
2 g3 ^: o$ ]; ?) v' T* ^1 W! V3 [    set A_i to 14 Y; R/ `! b7 H+ {# O) Q
    move into Q_induct1
  l& _5 E. V1 n4 c, E; Q    move into pickaisle.induct1) L& q. w  v0 X2 N* P8 h
    while A_i<=30 do begin4 F0 _& X& @$ F2 a: r, W" w
        travel to pickaisle.con(A_i)
) a/ A1 @! F3 P0 O' u' r- ?/ x2 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 a. v: K- ]! }4 w5 N; m# Y
        else wait for 10 sec& {+ ~; `% R) O* v4 l1 q
        if A_i=A_leave then send to die: T% E& y) E+ c
        else inc A_i by 1
9 U  u9 X4 @9 c6 T9 l    end
$ u/ V9 @. m2 a6 I$ v9 gend$ f, _! T0 I' m. X. n) @2 i  {
8 ?4 R% i4 u% N' E5 k" l
begin P_pick2 arriving
) O* C/ H5 n. |( v3 H0 n    set A_i to 117 H0 u8 @" j* s, _$ b
    move into Q_induct2
3 P6 S2 L; j: f2 p0 P    move into pickaisle.induct2
( i9 P" d$ C7 B& B0 C    while A_i<=30 do begin4 a- l  p3 n* C9 U, W% B: j: p
        travel to pickaisle.con(A_i)
8 L6 n2 {5 w9 _4 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! a$ i* A% i2 m/ z% L$ ~7 i/ @- D7 D        else wait for 10 sec/ U3 p' B. H. F1 \1 z  g
        if A_i=A_leave then send to die$ W& C5 U9 [5 G- y" o' W
        else inc A_i by 1
7 T. ^. x3 _3 b. R3 B' j    end' ]1 p8 K' Q/ A$ h
end
! n6 m; Y1 O) J4 q3 Z- q
  W7 f; g8 F: {3 M# `- Tbegin P_pick3 arriving, ~' r* A. \& e- `
    set A_i to 21
' X) g' H9 D: K, q9 {5 b& I& ]    move into Q_induct3: f8 J$ u( Q8 u& G
    move into pickaisle.induct3
+ D9 Y/ x0 h: u% C    while A_i<=30 do begin' V1 l* T' s* x7 g
        travel to pickaisle.con(A_i)
1 w2 P. S1 N1 U, _& Q2 C4 W. T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 @8 F" [2 I+ p
        else wait for 10 sec
1 _- g# x3 ]6 F7 O* F        if A_i=A_leave then send to die3 k5 x- C& U2 u# S$ \8 e6 a
        else inc A_i by 1; U6 K3 F' q- \8 A- K) S5 U; ?
    end; e9 `$ v+ ^6 m$ G2 s2 n
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?2 P+ ^8 }" M$ ]# W3 r& m4 \$ ^7 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 P* E. R, g+ W2 L, H3 v

% O7 ?) G0 o- ]; l7 C0 }AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, \+ j. i* I2 R

! _# K2 k. B- ^9 X8 W3 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ S! F5 V- |6 w+ Q& w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 {9 v8 L6 }# m, ^( Q+ T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 k2 R+ E) p" w" Y; o3 X" z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 w5 i6 h3 S6 Y0 R* h9 Ibegin P_induction arriving
. |& H+ n# S  n& x. M; \7 v9 _    clone 1 load to P_pick(A_induct)
0 `. G2 ]% b! h( r7 nend最大的系8 G$ D/ n; j/ ^

0 J9 H) U# _: ^2 [begin P_pick arriving$ Q$ Q, L! W, v- @
    set A_i to procindex * 10 + 1
+ y. y) E0 s1 F8 J  N    move into Q_induct(procindex)
6 Q: ~" y7 f, v    move into pickaisle.induct(procindex)
: I6 u3 F) u* ?+ w6 h    /*check the type of pickaisle.induct(i), for your last problem.*/
  O- R# @9 W0 M1 t! q3 @7 A: T  {/ F' X# m. m1 b  a4 A
    while A_i<=30 do begin' H% B8 J0 `5 N4 N3 W, E
        travel to pickaisle.con(A_i)
8 ]8 W" j2 [2 U* V; `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% U, V- [! K8 ~; x6 _: r8 t; X        else wait for 10 sec
! |* n8 d6 `8 \        if A_i=A_leave then send to die
( Z# f7 C$ l# o2 J2 g& |( j4 @1 L        else inc A_i by 1
* F) E: F" k4 H: d+ V7 I0 c) k- V    end
' Z* \3 `% m* k3 xend; |2 j  N8 o& g( A. Y

' O  G. [% ]% R* o- N7 s其中的procindex为整形,代表当前process的序号。
' o& }' b5 |0 ~9 v; ?station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-3-27 22:00 , Processed in 0.023856 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表