设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13267|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! Q  g- y! r2 p' i" y8 Y1 j
, B! R/ s6 d9 A3 o" u9 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中的数值,不知道会不会有什么不妥。: ?2 r! S3 V7 A: S4 ?9 N1 H$ G* ]

) Q! A  {% l/ Y) G/ ^  A' ?/ xbegin P_read arriving) Q, c& I5 ^! |: @  u
    while 1=1 do begin
8 o: L; Y! \3 J2 i( y        read A_tote from "data.txt" with delimiter "\n"
5 f; f  O  J2 c: |, w' [        read A_time from "data.txt" with delimiter "\n"
2 ~1 C# g. j7 k; {$ m6 O0 u        read A_leave from "data.txt" with delimiter "\n"
/ x5 C) h( @% I/ S8 i" X" j        read A_picks from "data.txt" with delimiter "\n"$ N* q+ j0 `( g, h9 N& _
        set load type to A_tote
! _/ u) S! I' r/ V+ w: [6 i$ s        if A_tote="tote 1" then set A_induct to 1
& z" D) |8 j. q% \5 a1 z        else if A_tote="tote 2" then set A_induct to 2
( S$ h9 s# A* [4 i) p' k            else set A_induct to 3   
  r3 ?; ^0 {7 X9 A        set A_i to 01 C- o2 O6 ?7 x+ b0 i. a; P
        clone 1 load to P_induction
. \9 h/ k/ b1 o# s/ O        wait for A_time sec5 N( B# P3 M, ^( |0 X: ^; |
    end- _( Z& `1 `4 ~! c) l) X! o( l
end
+ p' G: ?7 R$ C/ A. Q5 J3 r& R' ]
begin P_induction arriving
! ?5 C$ d1 s5 @" @3 @    if A_induct=1 then clone 1 load to P_pick1
! t4 @. C6 |. Y( ~    else if A_induct=2 then clone 1 load to P_pick2
7 s& O1 u( N0 d/ A        else clone 1 load to P_pick3  u' @! F* }* F5 ~' I9 R/ i
end
6 C0 H* J$ H" l2 N" h# l+ L! x4 |- _9 P% C% `8 n2 q
begin P_pick1 arriving
0 Y, T9 K9 H6 Y/ l4 L/ l    set A_i to 1) a( {3 {  J3 G5 z% D
    move into Q_induct1  P4 o+ ~$ ~- E& s5 U0 K3 x
    move into pickaisle.induct1
& Q. B. R1 a: b1 K5 k) B. a6 m3 V    while A_i<=30 do begin3 W3 e: L1 m+ Q+ y, U/ U& Q
        travel to pickaisle.con(A_i)
  X$ y) e# `3 I0 J1 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! F4 J/ s5 g. z1 m        else wait for 10 sec. h& D( w0 ?0 v. y" X' M8 z
        if A_i=A_leave then send to die6 ?% s; M' A3 `/ g2 j
        else inc A_i by 1/ W  N9 \( F: X
    end1 U  a9 O- Y  l8 p2 |( ^
end
: q6 A3 P1 p" q6 p
$ j! \! Z: \( Tbegin P_pick2 arriving
" I  Y2 l. _4 s* C  a4 L    set A_i to 11" g$ N) W% K" `
    move into Q_induct2
. p; s) J8 m8 k- E  O    move into pickaisle.induct2$ B5 y, F  \, {, t3 ^$ H) y
    while A_i<=30 do begin, |4 d; H. ]  [0 g. s% {
        travel to pickaisle.con(A_i)
0 X3 g/ u% o& M& u# l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: l9 }9 y* D3 p" {0 F* P" s8 b
        else wait for 10 sec
$ Q6 m" x: T5 v9 M' c8 o4 j        if A_i=A_leave then send to die
, \5 L4 u) _( Z) f        else inc A_i by 1
# w* s, L, \5 Z+ Z- M    end% k" v! e4 q+ d5 x
end8 x' p; g  U, Q; |7 Z9 \
+ ^$ @) d& {$ I& ]* v
begin P_pick3 arriving; n: h: q7 X& ?' ^
    set A_i to 21
& W" k" O  F) s* n3 _: i$ d    move into Q_induct3
' k6 |/ E& s) u, F' V" Z* M    move into pickaisle.induct36 X0 d$ `4 H  F7 G, w
    while A_i<=30 do begin! y% M. O- E! f# P; e
        travel to pickaisle.con(A_i)" r0 \$ K: }! v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ A$ t- Z" T1 Q* g% S
        else wait for 10 sec
7 P2 l2 p6 P% C: c& w        if A_i=A_leave then send to die; {# e8 y$ f7 f& J' Q, M5 v7 @
        else inc A_i by 1  @' ~; l% V. ~. O8 ?
    end; \* ^# y- g5 c# 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是个什么东东?* H% V* ]7 z9 V4 L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 ]2 P5 C* B% ~- m/ q) g7 J) L7 E

9 m' v# a9 W. PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; F- R- B- y+ F! F

$ `0 p4 R; |* ?. t! c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) p* l+ i6 D8 b1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ _6 C' r6 L% t4 j- ~4 a$ M+ s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" @9 V6 f- s, o; n7 Z, n2 F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ k4 h" _, K- d
begin P_induction arriving
* ?  p+ j7 @' o. X( a    clone 1 load to P_pick(A_induct)3 I! Q, D9 i; \/ Q
end最大的系4 m$ j" G0 }; x

, R( A  E8 D6 A& mbegin P_pick arriving! A# Q  M* M# t, Z
    set A_i to procindex * 10 + 1$ ~0 j, }' I" [1 ^. p. m  y9 ^
    move into Q_induct(procindex)
9 S( G- T2 M3 G% m  X3 G    move into pickaisle.induct(procindex)! l* g8 h; \; ~* D% I' K; i! o
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ V2 {) F4 e+ X6 a8 ?% R- v% J
0 x8 X1 j; \% z* L! c    while A_i<=30 do begin
! I1 t* L5 x2 z; W. T& ~        travel to pickaisle.con(A_i)
) u+ _! V& P5 w2 }+ O) M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; c) k2 w! a' X8 u0 D7 \
        else wait for 10 sec. J% u" c+ a# P. Z. z# r9 l1 k  T
        if A_i=A_leave then send to die
; _2 i$ Y3 v  G& Y        else inc A_i by 19 O+ _! P2 ]; r; u
    end
4 i1 s# T# P/ b2 g$ r6 ^end
) |7 C; p2 u2 F/ ]. O" {3 f  M
其中的procindex为整形,代表当前process的序号。8 }* U# n* V; M3 |7 Y" 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-31 11:55 , Processed in 0.018127 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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