设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14206|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 T( r  z$ Q# L! l- b" ?8 f+ {1 V9 E- S5 o& A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 P, I9 A" x$ N* N$ J6 ]  r9 y7 u8 r8 X8 ?
begin P_read arriving
6 y, Z4 L- t2 a( n0 C    while 1=1 do begin
8 l. S. {) d' P, ?( `8 T5 K        read A_tote from "data.txt" with delimiter "\n"
" X1 X. b2 m1 Q/ ]        read A_time from "data.txt" with delimiter "\n"7 _, i! V% z4 S: n6 [: T8 M4 v7 z
        read A_leave from "data.txt" with delimiter "\n"
& y$ H5 T* n2 O/ K        read A_picks from "data.txt" with delimiter "\n"/ J  s6 R' I. z) @6 y  c- q) @5 D: V
        set load type to A_tote6 O; y& m% ?6 ~
        if A_tote="tote 1" then set A_induct to 1# n# W3 J) \5 v; Z; v) g
        else if A_tote="tote 2" then set A_induct to 2$ Z5 {6 z6 W7 u4 H. ~# ^
            else set A_induct to 3   
  ^9 ^+ D- D; z$ c: g* ^        set A_i to 0: Z0 L! s6 i; b; ^, p) K
        clone 1 load to P_induction
. ~) K! ]' j# P* }& U* b  E        wait for A_time sec
/ t9 n9 Y4 x5 R8 u  J    end% D* j5 U0 D7 @# E6 a. h$ v
end' r: l% {4 |6 u) U

. g" {8 d3 }/ |, i) o3 hbegin P_induction arriving
; j( i$ S6 d+ d    if A_induct=1 then clone 1 load to P_pick1
. `% V$ t4 y. }& |  z' h. _    else if A_induct=2 then clone 1 load to P_pick2) u' p! O+ K3 j7 `) W( Y! X' V
        else clone 1 load to P_pick3
  L4 X, o0 u* A5 D, X- r" Dend
1 A/ O, I! Z' i
+ s( C1 C' ^7 d- o8 Ebegin P_pick1 arriving& x" ?# d0 B( l8 V9 f
    set A_i to 11 ]0 k( A2 T( H1 x; W- B
    move into Q_induct1
; S8 ~# Q: p, }' O; ?( x$ n+ R- E    move into pickaisle.induct15 K7 I- J; P7 P/ k5 g
    while A_i<=30 do begin
3 a0 O! O  G. c9 ^' ~- d1 \        travel to pickaisle.con(A_i)7 _- C% w, Q  }: v3 M& Y; H8 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) n2 @+ Q9 a, z6 [7 `5 h        else wait for 10 sec1 K% U) c8 A/ _# x* E+ s
        if A_i=A_leave then send to die
% m+ H! {! j/ B/ L        else inc A_i by 1
) F" m" w4 k& v+ E: q    end
' [" Y+ \" |- ]( B$ {( ?7 r) Rend/ r: I) |8 z1 Z3 Q5 D. Q4 ?( |
! _$ t+ i; D  X+ x+ `
begin P_pick2 arriving7 e; E( l3 N2 J) i" u- d/ Z
    set A_i to 11! q5 g) M3 p5 i& K
    move into Q_induct2
+ P. @% f7 R/ q; l    move into pickaisle.induct2
) m% j) F- \/ i    while A_i<=30 do begin
! w  S0 |6 a4 Y8 L% j        travel to pickaisle.con(A_i)2 y0 J- a& P0 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 b6 N4 d0 A/ U: w3 K3 L% Z5 I        else wait for 10 sec8 ?; D5 `' t1 k4 L3 m; T
        if A_i=A_leave then send to die
5 n9 f+ x# ?. J, k1 d        else inc A_i by 1
' ~1 B. \: O9 o  d8 u4 W    end5 ^, U$ n* S1 U" v/ e
end4 f2 w' @2 t7 f7 c# ?7 L
. ?! i7 i# q0 R: A+ F) q) ^& }
begin P_pick3 arriving' e3 r. X3 Z: n6 D9 ^
    set A_i to 218 W5 w1 G1 @9 X( R/ M
    move into Q_induct3
; Z8 l( Z$ c0 X1 r( w8 |/ R) g1 ~    move into pickaisle.induct3
# s+ o3 [7 [9 g    while A_i<=30 do begin
- t7 @1 a$ c' m/ n  v        travel to pickaisle.con(A_i)
( Y1 g& N5 x3 E$ t- g. E; o3 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; e1 H9 a+ p/ ?2 S) J( J; M
        else wait for 10 sec9 T' r! \" I- l# a! u' \
        if A_i=A_leave then send to die/ Y' ?" v$ ~% T" U8 r
        else inc A_i by 1  e( b; R1 z* V6 V3 Y7 t$ x
    end
& t$ [0 D3 K7 d+ A% \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 ]6 `7 p* M/ vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: l$ [6 k2 ?* r' i* _2 D; h! k1 J( g' b5 G  O, f6 y3 o1 z( a' o2 O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ P- T; d0 p( V7 Y% y9 D' m$ w, {4 G* q; H( b7 i8 G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( P% l) _! V* ^. J+ y/ Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* N. S& W# `( o, I9 y/ @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# ~+ c( w  D! x9 r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ @+ T, C; Y$ p/ a; Y: Q/ U6 Abegin P_induction arriving
5 j( Z! h* [8 i" S    clone 1 load to P_pick(A_induct): m9 r+ v# Z2 Q6 K  y; j2 S
end最大的系/ f/ f$ m8 D+ ?! k- ?
) I+ q1 }$ F! C7 g# w+ W: G$ ]
begin P_pick arriving( u* L$ Q, \1 \! ^$ v) Z# \- s; e
    set A_i to procindex * 10 + 19 B  @8 o) t( x+ l" r% [1 [; S
    move into Q_induct(procindex)
$ Q8 r$ y. `+ Z2 _    move into pickaisle.induct(procindex)
- v- S2 d6 K2 x    /*check the type of pickaisle.induct(i), for your last problem.*/
2 n! b+ s# i8 P8 \
/ m/ `, C+ a! e  l/ ]    while A_i<=30 do begin
: b0 j& k- E# [        travel to pickaisle.con(A_i)
/ T8 K& B& s! B2 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 f+ e' \5 ^! {" o        else wait for 10 sec* _2 e- y7 z0 V
        if A_i=A_leave then send to die
- P4 o; `( W3 F+ c+ }; B+ `        else inc A_i by 1
  B( j. c4 e5 M  ]    end5 q" Q* |' L) ^5 B" {
end
# i5 o3 F# o+ d# W. t2 k, m" |- u) H
其中的procindex为整形,代表当前process的序号。
3 G3 @8 `  \: I/ a& _+ wstation和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-6-20 07:36 , Processed in 0.018026 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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