设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13314|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 r2 h+ {6 [- V: D3 o, r0 H
6 K: K0 m0 R6 ^+ |% Y: d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) ?+ i3 A, t6 ~2 O; A& f3 G" w6 u8 W# i, ^' S% t
begin P_read arriving
* E( {" N! f3 P8 c* F& \    while 1=1 do begin
) k4 o7 }5 N! I, \4 E& U5 M' f- ]        read A_tote from "data.txt" with delimiter "\n") {" d" U6 J( y
        read A_time from "data.txt" with delimiter "\n"
5 S/ n" Y4 `. X9 Y        read A_leave from "data.txt" with delimiter "\n"' S; P( H7 v/ T$ H) d' ?: O0 h: [
        read A_picks from "data.txt" with delimiter "\n"- I' d1 k" i$ ~) J" [' G( p% L: C
        set load type to A_tote1 Z' ?; E4 ~& [/ t. W" q
        if A_tote="tote 1" then set A_induct to 1
$ Y* F, L) j1 H( v  U$ E' [1 C        else if A_tote="tote 2" then set A_induct to 2. t8 w) M- U$ Z
            else set A_induct to 3   
1 N! h; W: V# x/ W  \& ~        set A_i to 0
+ u1 P+ H# M; N8 G" D& n        clone 1 load to P_induction% q. n+ R. ]% u6 L& J, o
        wait for A_time sec. A" x# o6 H; ?3 r4 m; L
    end8 M% x* y5 r' [$ w. T5 M0 G
end  U, j: P1 r' H8 w+ n
( ]% E- I$ {# L( E* A, `$ O
begin P_induction arriving
6 V# r" P9 O  ~& s    if A_induct=1 then clone 1 load to P_pick1
: D- q& n# F* n+ B/ n8 f+ {    else if A_induct=2 then clone 1 load to P_pick2. N5 K% q" J. a
        else clone 1 load to P_pick33 E6 F5 S; K, Z( }" E
end3 g; D; q; y( Q* F) F0 T
+ \/ t5 A- o* S0 Z& }! u
begin P_pick1 arriving( ]  f1 ?, p0 ^, G2 w' o& Z
    set A_i to 13 k# ^! Z, [5 y- c  k
    move into Q_induct1
: X8 N% W4 Z9 z0 H$ @    move into pickaisle.induct1. R$ f4 ]5 W7 d7 e  a
    while A_i<=30 do begin3 f& Z7 }' d3 [# o- Z4 D. z
        travel to pickaisle.con(A_i)
7 L; K, t7 I8 P  A5 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' {6 \; U$ B5 c& `        else wait for 10 sec
9 w0 W3 s2 U- v        if A_i=A_leave then send to die. v5 K" i+ a1 F+ L) ]
        else inc A_i by 1
# F6 ]" j0 i! e% P  B- i; v# Q    end
: ~( T. |+ R1 {end- c( c2 J0 ~* k# K

% V5 Y* r9 @: Y6 f1 q2 m2 fbegin P_pick2 arriving/ g( |% D1 x2 [5 ]: y0 _
    set A_i to 11' Z& v3 |$ M3 @+ |4 \
    move into Q_induct2
+ ~$ f# V% t. W7 L+ Y3 q    move into pickaisle.induct2& Q7 Z% z9 ~# r; e4 h' H* g9 S
    while A_i<=30 do begin
+ N: r2 y% g- F4 T, Y# i        travel to pickaisle.con(A_i)5 ?% t' V8 @+ L' ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 a9 O  X, t2 V5 k2 b- {
        else wait for 10 sec6 D1 n: Z4 l$ z/ t# w/ N8 k
        if A_i=A_leave then send to die) U6 K" o, n6 e- u
        else inc A_i by 1' @( P; T* y( `$ @
    end
+ N7 P8 D1 J2 \) B; G2 W9 ~end+ ~( w+ h& d! S$ T" O
% q& J( P* I% B, [" \4 c
begin P_pick3 arriving, C- [( u0 [0 ~
    set A_i to 211 u# B+ q  J$ B( f7 Z" y
    move into Q_induct3
1 Z' H; b' B7 |2 ]    move into pickaisle.induct3
  {6 D( I. h+ r& F& |' C8 C. o    while A_i<=30 do begin- A% q& V1 ?0 Q, v5 [
        travel to pickaisle.con(A_i)8 Z0 a+ i' I/ V" R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. t. o8 x8 Q" @2 t6 q        else wait for 10 sec: `/ ?% Y- @$ H' X
        if A_i=A_leave then send to die
: Y. ~# o" D! G. k3 `        else inc A_i by 12 d# r; I! l' b& ~" ]# X
    end
, b! {+ H0 }- A9 X7 Q1 S; ^! jend

最佳答案

查看完整内容

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 M' d- f( C- m9 H+ G( C' r# v; e; }+ b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 C- n; {+ {& X: l& |4 u

$ o% b, [( {. F. \+ U1 lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ T( E' c' e8 ^% b' J  v1 W
( `* k9 ~: L7 j* e4 n" Y) L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: N  b$ |. a* N( j1 {
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ o& P2 W: j' C' V( P- G4 `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 g' ^6 o+ B5 I% [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, Y/ Q; ?! c# T1 D- @begin P_induction arriving4 W/ A& v+ o9 J( P& v
    clone 1 load to P_pick(A_induct)
( T. |$ T  \0 ~& Wend最大的系. @8 Z' b: M9 k0 ~: ~
; y2 {, g+ {  c! Q) B
begin P_pick arriving$ S" F% ?" \% l; e
    set A_i to procindex * 10 + 1
3 X, O$ e3 L# f5 N2 m' t) u    move into Q_induct(procindex)
# j# g- S1 i0 r+ T1 V8 {2 |  n. m    move into pickaisle.induct(procindex)
" z' [7 _" z8 A2 E5 d. A    /*check the type of pickaisle.induct(i), for your last problem.*/3 r/ S6 @( L: i0 ~# j

) R/ m# b0 ~. A  T    while A_i<=30 do begin
$ P2 E9 x- m1 L        travel to pickaisle.con(A_i)+ B- a  j5 x. ]$ X* P4 w9 ^2 a% M) x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ M- ^3 j+ |; Y3 i# b" J- b        else wait for 10 sec
" n9 O4 r! X( B2 h2 J5 p# ^. Q        if A_i=A_leave then send to die
5 N7 q6 e4 w$ j) Z6 |4 I6 K        else inc A_i by 1
; V2 `, }$ {+ ^- r' p4 q    end( |1 Q( ]6 `5 q2 }* @4 c) H. U4 T
end
+ u7 V4 c8 J! [" Z7 f, A. P
/ t; d3 K. r+ Y其中的procindex为整形,代表当前process的序号。2 h, ]" M3 N( W# W: _9 Q
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-4-3 06:54 , Processed in 0.017605 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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