设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11624|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, g( b+ x6 o: n9 C( E: ~% h0 j
3 L9 n! }- V" X( B  v' K我的问题是,在每个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中的数值,不知道会不会有什么不妥。& t$ s: |( {/ S' M. l: n) J  E7 N
* m5 Q# c) V* ^/ N
begin P_read arriving3 Z! j7 A6 g# |$ _# U; G0 j3 t
    while 1=1 do begin% _3 O  d+ F( w+ m
        read A_tote from "data.txt" with delimiter "\n"
8 H6 e& T( q5 A" t- z" G* f        read A_time from "data.txt" with delimiter "\n"
* _9 q# m! i$ @8 x3 k3 Q( F        read A_leave from "data.txt" with delimiter "\n"* s! l2 Y% `+ i
        read A_picks from "data.txt" with delimiter "\n"& K# m  r/ y% U2 e9 C+ _
        set load type to A_tote! c; }% }0 [* H, W, q
        if A_tote="tote 1" then set A_induct to 1
" A, `' t9 J* i8 V        else if A_tote="tote 2" then set A_induct to 2
$ U8 W' s: T# {6 N2 b9 d            else set A_induct to 3   
6 A' [# z( [# m        set A_i to 0
1 o9 }! I, {+ n! _7 e+ J% S        clone 1 load to P_induction
9 d% G% W, K# P2 G2 Z  z* j        wait for A_time sec- Q/ e4 V1 A& A. G$ t
    end
3 D4 r" D6 G5 \* V: O* A2 }. b8 Eend
9 Q. K2 X9 {7 r& c7 T' m& O$ ^/ w5 P3 v4 I/ [
begin P_induction arriving
9 O. D( t/ o5 Z; Z# {5 b    if A_induct=1 then clone 1 load to P_pick1/ M& Z, M: F8 u5 h! A
    else if A_induct=2 then clone 1 load to P_pick27 U$ |; Q* E$ O
        else clone 1 load to P_pick3/ \" T! p0 b/ a) t% @
end8 z# _' Q: b* A# F3 E) I
5 M- B, z/ h% N# R
begin P_pick1 arriving
2 K$ o, T- A$ r6 I9 J5 C: b) {    set A_i to 1+ x) d1 {7 a) p' N* s) {
    move into Q_induct1
2 Y1 h1 o/ @& D7 \    move into pickaisle.induct1
( D% Z: J# f0 ?. j2 m    while A_i<=30 do begin" f7 j  ], n' S1 [% l. g1 P
        travel to pickaisle.con(A_i)
; B: A& X$ d5 [( w- x( K+ ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ]3 j, f" _: K6 Z  h% {        else wait for 10 sec
/ ]2 ^$ l# _& F% H        if A_i=A_leave then send to die* X' g$ U7 }, I7 h; }
        else inc A_i by 1
; j, d8 l: a9 W- A4 Y7 F, q3 X    end
: i5 o8 B0 x3 _$ ~end, G; u/ ~" r9 g" |' L

( b$ z( o: `6 M/ s& fbegin P_pick2 arriving  F$ w% W2 ]' D0 v' ~- ?. u9 _
    set A_i to 11
+ c; |% n; X+ L( H  A# C' B4 {& Y2 G$ I    move into Q_induct2" W) n* h  c8 d
    move into pickaisle.induct2
; y  w; @' y. h$ g1 m/ Q. i    while A_i<=30 do begin/ P: P, Y+ q% h/ g5 N- o
        travel to pickaisle.con(A_i)
' W# q% Z3 V  @: E: j1 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d3 {9 j6 b6 N# ]6 S
        else wait for 10 sec3 n5 }4 q' T3 \% |
        if A_i=A_leave then send to die
' C) a! `6 S" f4 Q3 P2 e        else inc A_i by 10 F+ E6 H0 l" h: C
    end, i7 D$ p+ s  z
end) @- V* F- @; D
4 {5 q+ Q+ \& H" b* W( t
begin P_pick3 arriving
1 q$ X+ r( ~2 j+ X4 a/ }' I    set A_i to 21
( ~3 z" \6 n2 `7 g+ u    move into Q_induct3* T/ w- F# P1 z
    move into pickaisle.induct3, `& v6 v- I/ N- K3 n
    while A_i<=30 do begin* ]  k7 P; e+ P8 ~0 \, Z
        travel to pickaisle.con(A_i)% y6 R3 |2 ]/ d5 m. ~: k+ @" s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' O, z9 o. N+ X4 o) s5 a+ Z5 o% ?% [        else wait for 10 sec, n' M1 q' {. }5 p7 R/ A( t
        if A_i=A_leave then send to die
" ^$ b8 J& N" b7 F! ?" A        else inc A_i by 1/ j- P6 V4 J8 f  n9 b: v1 }, ~6 H# v: E
    end' I+ w3 _1 [" F; c: l
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是个什么东东?
& X1 B) Z( B4 O8 amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& N+ V. _7 W$ z" Q) Z& R* K* L* s! u' A; E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) M- ^, F2 ^/ I: v- T$ @' C" X2 {3 l; m( y  g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: M! x$ H* Y. v' r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- b% d0 `# I1 q. X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ E. m& U. ^2 C1 i$ A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ L$ A4 r5 ^$ R  W
begin P_induction arriving
+ `4 J7 p. D4 P, p' E! ~    clone 1 load to P_pick(A_induct)
; G7 y  A- f8 s& [& z. Q+ K8 lend最大的系& U0 Q+ R% }& T+ T

! d+ w  l2 |; I1 A  |7 T% ibegin P_pick arriving
$ V: [. p9 U! S  x! a    set A_i to procindex * 10 + 1
/ Y; b( s6 [7 h. w' l    move into Q_induct(procindex)+ N( D, @; Z6 i9 Y, m: C
    move into pickaisle.induct(procindex)- O' ^8 W1 y) w& K# m! u: o
    /*check the type of pickaisle.induct(i), for your last problem.*/1 t1 L' a: w$ @

) e( r) e0 Y" H/ `- P/ l    while A_i<=30 do begin( F; {$ i! }! |7 [4 A
        travel to pickaisle.con(A_i)+ T" Y" |: Q5 I1 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 G. ]/ a9 D. @) I2 F+ f/ E" e        else wait for 10 sec
, ^. L) r' I6 ?2 @# ?, W  X3 C        if A_i=A_leave then send to die& V/ Z1 g& o. Q5 P( h4 ~. H
        else inc A_i by 1
3 G. ?+ i6 Z# ^0 x& O8 P( j    end
. Q, w7 n2 M. g) {- _end7 r2 B# ]4 z8 A# l

' l+ L, @0 s& _1 m2 l1 k; r0 F其中的procindex为整形,代表当前process的序号。
- I8 I, C& B" |% v$ bstation和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, 2025-11-24 06:51 , Processed in 0.018211 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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