设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12938|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* J! p) B/ k6 c) ]7 C7 ~+ w4 Y! i
5 A$ T/ K3 |2 X* ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 e" R. o5 b$ ]/ D$ z0 N7 L+ u/ Z# q- z. B  ~' R5 y
begin P_read arriving- S% R- f7 i2 \4 F) V. Y$ t7 T+ K
    while 1=1 do begin' D* s0 A% D* u% A: z
        read A_tote from "data.txt" with delimiter "\n"
0 t0 O' w7 }- j% E. p        read A_time from "data.txt" with delimiter "\n"
/ Y* @7 R  U) f& Y* {" s, J        read A_leave from "data.txt" with delimiter "\n"
8 Q! N! |$ }/ I' f" e        read A_picks from "data.txt" with delimiter "\n"
+ W" D5 j4 r) C9 J$ Y        set load type to A_tote
$ t5 m$ g2 h* H+ }- E- }        if A_tote="tote 1" then set A_induct to 1* C: F: R0 B! X3 l
        else if A_tote="tote 2" then set A_induct to 2$ S. p5 t/ `0 V
            else set A_induct to 3      P% T8 C  E( r2 r: I- B- S
        set A_i to 0) s( M" O' P& e2 n# L( K
        clone 1 load to P_induction: a: j: S/ _' D' M, X
        wait for A_time sec1 v4 d: m3 n: i. E
    end
6 X( S% G7 n2 t. V5 f2 a4 ~5 M) i) Aend
+ s1 O& O, K* p$ o$ b
$ @, n9 F6 p3 A! w& R& fbegin P_induction arriving2 B2 C* o; c8 G
    if A_induct=1 then clone 1 load to P_pick1* u3 B$ I9 o3 U
    else if A_induct=2 then clone 1 load to P_pick2
- t0 Z$ @- Q' [3 a0 r! E        else clone 1 load to P_pick3* W4 F9 F3 G9 d
end) H0 E( {# i$ @5 U: r+ I' R

+ I( G& b0 `9 F* @$ ebegin P_pick1 arriving. ?. L# K$ ]0 u" Q' _  y& s
    set A_i to 1
% R7 \1 y2 n3 j6 i. h/ R: u    move into Q_induct1, i$ a' ^  r( t9 M5 l2 _- x, [
    move into pickaisle.induct1
- O6 ^7 P) ^8 b, \    while A_i<=30 do begin
7 U' E5 X9 p! F$ j        travel to pickaisle.con(A_i)
0 r0 u7 }8 l/ b% @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' a+ q. Q' p$ p# ]        else wait for 10 sec2 z  U- z" u9 x
        if A_i=A_leave then send to die
1 G7 f# y$ t/ `, m1 N  z        else inc A_i by 1- m/ s1 _% f% a, Z6 T' G  N
    end+ g( {3 c) `4 A
end1 |4 I6 Q( q4 z" U( h

7 L8 z. z4 v( Q1 \. s/ P( Tbegin P_pick2 arriving, q( e8 ^( U4 n" `7 e0 Q' z) r
    set A_i to 11# E* v0 Q7 F, @9 ]$ N- q8 N
    move into Q_induct21 F3 g, {; n% l0 }4 H
    move into pickaisle.induct2' V% S: b; X0 z- H  z6 d4 Y; U
    while A_i<=30 do begin2 J+ W7 S/ W+ }, O3 p' k4 Q
        travel to pickaisle.con(A_i)
' \! e) Z4 b1 S0 s/ }4 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 H) n0 w3 h% O7 F" B8 B5 }        else wait for 10 sec: F8 c0 M4 O; A- X. ]
        if A_i=A_leave then send to die, c: ^0 R1 k% _* D( S" x, T
        else inc A_i by 1) A. J$ }2 @4 U( K7 T3 F# d8 Z
    end$ ]/ e' @9 n0 A) e/ J) ?6 a
end0 M6 j" k+ R$ l4 }) ?
+ ?' k5 X8 k' n; ]9 N( f
begin P_pick3 arriving
$ Q4 g  w9 b, D! t: E, y    set A_i to 21
6 W/ R" \/ a* z5 r) S# B    move into Q_induct37 R* L* v- I6 c
    move into pickaisle.induct3% u! k+ |, _: s0 t+ b
    while A_i<=30 do begin
$ C, V9 w0 q" ^, x& v        travel to pickaisle.con(A_i)/ W. @& Y, N7 ]3 J9 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& m, S) h; B. v( {. Y
        else wait for 10 sec
0 K7 Q* G. H, q. P& U! _! q        if A_i=A_leave then send to die
2 g$ `0 ?$ c1 g1 {        else inc A_i by 12 c) ^/ G$ a& w4 d! {
    end
- L" N7 P; c2 Z* E. m+ dend

最佳答案

查看完整内容

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是个什么东东?
; u3 P0 \$ R6 q' Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! |2 P5 z/ p" S  D* f
% E. v' o' ~7 A' R( e3 GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 y* U0 `$ {. h+ K/ {
2 A: E# i0 v  g8 J% i9 M; e6 t, T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: F2 N& Z% y3 W9 N" Z& U1 M8 b+ e9 X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 ?0 N4 ^- s' d1 G* d  Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& {7 w$ |$ z6 U  a/ f* v( X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ s' a: j. h; t8 U4 obegin P_induction arriving4 E5 Q! S( x/ r) @0 k
    clone 1 load to P_pick(A_induct)  X, \6 n2 L" u% h' Q
end最大的系6 X6 }5 G: u1 ?+ M* i

' |! @4 p  W1 @& |  u8 L1 U. cbegin P_pick arriving
/ I' V" C3 ?, v5 [: A) t+ e    set A_i to procindex * 10 + 1
9 t3 m. m5 G* I3 T. |' H    move into Q_induct(procindex)2 N" O7 D  |2 B
    move into pickaisle.induct(procindex)
  v9 x7 p( |6 a    /*check the type of pickaisle.induct(i), for your last problem.*/. q( ^2 Y" ]. ]$ O+ v0 n) X

6 w  R7 ]2 f2 ~4 l# A* K8 v2 X    while A_i<=30 do begin0 e8 Y6 f! f6 n
        travel to pickaisle.con(A_i)8 [$ Y3 x" p! K$ Z1 B* P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 F, a. v$ F% G
        else wait for 10 sec  P0 q+ X- J  ^& o" Y) w
        if A_i=A_leave then send to die( ?# o2 U  w9 t4 d
        else inc A_i by 18 B1 p. u4 b" g( N% c8 r- c& `
    end: H6 e$ y# \& d5 a0 ]/ b8 ^
end: K0 v# Q3 R7 t

) M9 }) `" O. k( @其中的procindex为整形,代表当前process的序号。
8 n) J, Q. u* f+ c1 i8 estation和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-4 07:12 , Processed in 0.017626 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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