设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15182|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' c2 j+ L# W- d/ ~; g4 h. S7 b: O: B0 ], P" e' `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 q' J! q% [  b/ k9 e1 M$ B* n

; [- ?7 w1 V. F6 I& `/ ?& n5 ]+ bbegin P_read arriving  B% j. |6 b" [/ L# j, M% W
    while 1=1 do begin5 h  ]/ M$ c3 _2 m% Y% m! b
        read A_tote from "data.txt" with delimiter "\n"
" t& x! v$ n3 P/ [/ n# L) |        read A_time from "data.txt" with delimiter "\n"/ c. r$ @) }" t9 E5 r  {1 |, G
        read A_leave from "data.txt" with delimiter "\n"
+ d1 h; g/ D6 l3 z; ^2 ?0 E0 m' }        read A_picks from "data.txt" with delimiter "\n"/ `- E1 x) q- G$ i; G+ s. }3 u
        set load type to A_tote# o! q  Q6 t9 z# a( f; ?
        if A_tote="tote 1" then set A_induct to 1
+ t: s# {2 Q8 w: Q2 {8 U: _4 m        else if A_tote="tote 2" then set A_induct to 2  l( \4 T) O0 p: ]
            else set A_induct to 3   
/ e- c3 z! o$ ~0 k: }        set A_i to 07 e; {: x+ ~! F/ J
        clone 1 load to P_induction2 G5 r/ \) A2 c  H
        wait for A_time sec
3 f0 {' o: i0 A/ T    end' G- j4 J! Y& f, K+ `
end# v% G8 Y+ S8 R5 a# b4 f" T
, g# {2 g) ?* |  i2 `8 h2 h- z: V; C
begin P_induction arriving
, l  u! c* C  }" V; o1 w    if A_induct=1 then clone 1 load to P_pick12 O( r- h& l0 @( J3 E; W
    else if A_induct=2 then clone 1 load to P_pick2
* f! l1 v) e5 ~8 J" R" r+ S/ q" o        else clone 1 load to P_pick3
& k8 y0 a* D% z* j+ a7 Wend
2 x# R4 W1 i) x& Z; ^% M- F% c# A0 A% ~! G" z( @
begin P_pick1 arriving
% E! M4 v2 Q. Z) T( |# Q    set A_i to 1$ E1 g6 }1 X) l8 G3 c% W
    move into Q_induct1
, i; i# n9 k6 a- P3 D; S    move into pickaisle.induct14 R6 \* N5 @7 _$ t; j
    while A_i<=30 do begin$ o% b- s4 M. z2 w  d1 ?
        travel to pickaisle.con(A_i)' v1 s9 S$ R, O/ D& F$ K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( Z* B) g4 O& X2 p; ^+ {% X* C
        else wait for 10 sec
# P  {0 T% P" f3 |# _, I" v: c$ L        if A_i=A_leave then send to die
8 M# R# m4 n) N5 c        else inc A_i by 1  d* c! T0 x0 m
    end
0 O0 ^; ]- ?- K2 fend
: g% j* I" @1 m7 J% g. n
. X7 f" r- P( P& d/ }, [begin P_pick2 arriving
$ X$ _9 b) ]7 ?: r    set A_i to 11
. a; R+ F# Y- Y4 X* u' E: y1 i8 g    move into Q_induct2, T- h8 U9 s0 V3 i9 m3 S$ z; o8 }
    move into pickaisle.induct2
6 ?' Y8 X0 C' G+ G5 F% S3 D8 @  m% `    while A_i<=30 do begin6 j4 Y9 w. ~1 n0 U9 g& n; c
        travel to pickaisle.con(A_i)
3 _" q' b( V* A, d$ h* C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" q9 `! w) H$ ]+ z/ x
        else wait for 10 sec* S2 X: A! J4 g/ A% G  E2 g6 l
        if A_i=A_leave then send to die1 J3 P0 {' i  A  v
        else inc A_i by 17 B+ ^2 H# o9 ^. q
    end7 d8 B) k/ o' X1 v" u* W9 f
end
- x/ H6 {; @4 i' `: A: ]
! r0 E1 f) k5 q& C0 \8 c7 {begin P_pick3 arriving
* z) H9 Q  r' y# O    set A_i to 21
+ r: g1 O$ ], u, D    move into Q_induct3
/ u# I# l8 k- T6 j. S    move into pickaisle.induct3& C7 J# K- R  C. p/ b
    while A_i<=30 do begin) Q  ]3 S2 r, M0 |* a$ |
        travel to pickaisle.con(A_i)1 z# k! ?7 |5 ?- X# n2 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* b: a% Q2 |; c8 D( Y
        else wait for 10 sec
, a2 h$ D. a" ?. i, V4 o        if A_i=A_leave then send to die  ?8 G- ^7 S( E4 [
        else inc A_i by 12 B. U, r; v9 C, ]: W7 B, m
    end4 E' v, K% h( _8 ^* C2 C
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是个什么东东?" E3 r3 `. F" r  \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" T: c7 M% i, B. \: w8 E9 q3 e% Q( a/ c9 G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 E; G5 ~% k. `

. Z% b+ y! E, p( K! H. x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" y5 D1 ]8 O$ n3 @) Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& Q' l9 c+ V: z/ x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 ]7 @, M$ j" d. I$ {/ X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  ^! a2 ]& C% B4 j  z+ m: A5 jbegin P_induction arriving" \# H0 s- ]7 D! f5 |
    clone 1 load to P_pick(A_induct)6 n" I! l$ `/ {4 T! \) ~- Q
end最大的系
: F' S3 {: k! K; I! j! J- P' M( K6 C
begin P_pick arriving! I) N7 b: o+ ]% A+ g; Y2 I
    set A_i to procindex * 10 + 1$ N  F$ y: Q7 S& k+ F( Z
    move into Q_induct(procindex)
$ t) i& G4 A# y3 h8 `    move into pickaisle.induct(procindex)
! N; q" c$ i* [. z8 B; ^    /*check the type of pickaisle.induct(i), for your last problem.*/! \' _5 a  K. R1 Y3 v' @
' w, v) C8 |4 _9 F$ ?2 P7 ]+ i
    while A_i<=30 do begin
  t$ D$ w+ L3 T. Y        travel to pickaisle.con(A_i), j: a; @/ M: M$ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- O; Y, f) [8 f: u3 }
        else wait for 10 sec
4 U! a8 Z' R1 O5 ^# \        if A_i=A_leave then send to die% x0 M" u4 D: p4 C- k% m  ^, M2 w
        else inc A_i by 1
9 ?9 Y+ V1 e+ w6 m    end  q9 \1 x7 W7 y! A: e& X
end( i* ^* i2 E3 H5 V7 B3 ~
5 v- r: U3 p# X' N$ T
其中的procindex为整形,代表当前process的序号。5 J, ^& z$ m( M% S2 o+ X7 o3 s
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-8-20 16:42 , Processed in 0.038792 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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