设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13503|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ ]! \5 i8 Q0 d1 f
& E' {4 m# v# G* [- @' o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 Q3 G& i6 ]0 J( N. Y" o* n- y5 E; k, b* ]5 r6 D* E
begin P_read arriving
2 x; U& N2 ~5 K( j    while 1=1 do begin6 J+ }) k6 J) l3 u; _) ~
        read A_tote from "data.txt" with delimiter "\n"
* h1 C& C3 X0 {+ }" {) z        read A_time from "data.txt" with delimiter "\n"0 {6 Q/ Z) e* u8 M+ W
        read A_leave from "data.txt" with delimiter "\n"
+ C2 e: h; [+ ~! j        read A_picks from "data.txt" with delimiter "\n"
. r" _' |1 d0 A1 f1 n        set load type to A_tote
* r/ h" c$ B! w5 H) w        if A_tote="tote 1" then set A_induct to 1# A# s- |% S0 t' p/ L+ n2 e
        else if A_tote="tote 2" then set A_induct to 2
7 m" a& \" G& j0 E! U1 ~! Z            else set A_induct to 3   
, K( l8 P. v% o        set A_i to 0
- Q: o! ]5 A! `, v6 j9 B1 Q        clone 1 load to P_induction
7 R; x$ P3 h  K* ?1 }9 |        wait for A_time sec% x* _4 S- h- G, E( }) i- S
    end# c4 p& ~4 D# o7 @* a
end+ o( j6 a) F2 L- U9 W/ S

- S1 {" R! K; c" Pbegin P_induction arriving
6 K* d: L: K- ?0 r. @    if A_induct=1 then clone 1 load to P_pick11 z8 d3 }: t  p9 Z9 v; j
    else if A_induct=2 then clone 1 load to P_pick29 r7 P. R1 O2 v! C' u! T
        else clone 1 load to P_pick3
$ j; C! Q8 m" W$ T% ]/ z! H% pend: C, D$ c2 |7 a' U. h5 N( K
, O: r9 x& ]$ }7 `0 E% t; u
begin P_pick1 arriving! h4 L  c; h* L% m4 R8 R( m
    set A_i to 1
. u' J1 M4 v6 ]! C0 r' e& Y. k    move into Q_induct17 V4 X% O" P. F/ e
    move into pickaisle.induct1
" T6 ^3 i3 s& r2 ^* }) w4 i    while A_i<=30 do begin" V/ K, O8 x" g! H5 e" g/ s3 v
        travel to pickaisle.con(A_i)4 ^  [- f" r( V% P- K! o0 b5 U# t8 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 }: n" _0 Y/ }( |  V2 f( x        else wait for 10 sec7 X) T+ G3 a5 s5 a% x
        if A_i=A_leave then send to die
$ W; k  M1 F3 K        else inc A_i by 1( T. D/ S' O' s
    end
2 F! g8 g) j: s: }end4 g$ T5 G- {7 [9 A+ h7 q' b% j
7 M, k2 u8 Q2 ^
begin P_pick2 arriving( v2 |2 N2 C% q/ i, j$ w) n. H8 k
    set A_i to 11
" k; Z* I3 m9 q& y" r+ D    move into Q_induct2
* [7 f/ O- c8 s4 i  w    move into pickaisle.induct2
2 L: ]& Q- _1 D: j3 R4 U. S: f    while A_i<=30 do begin% X+ i3 K# T9 \! s+ x
        travel to pickaisle.con(A_i)
) W1 h0 Q; B5 B" i5 y) p4 G; l9 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]" R$ J# `' C% s5 F7 X  q        else wait for 10 sec; ?* f/ L. B3 N5 N5 G; r6 Y
        if A_i=A_leave then send to die
3 y' u4 ]- i' ^& A( M0 K        else inc A_i by 19 \+ v4 [. S  x3 B( n
    end
+ K% f" q. f7 H! N4 L" g' N9 Wend* d3 h+ r) n# ?$ H- p

. j/ U9 T' D8 K+ [6 n& J& [9 H0 v1 wbegin P_pick3 arriving$ y' S/ N: J5 S, s; Z2 ~
    set A_i to 21
: @5 z2 I" A" ]    move into Q_induct3
8 P# b9 Q& U. C5 ^. c: x    move into pickaisle.induct3
1 L' }7 O1 X6 k0 }  R- F: g    while A_i<=30 do begin
6 y7 U$ \. _5 o) Q$ S! J        travel to pickaisle.con(A_i). j# C% E  h9 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z7 ]- y" R0 a" N. F
        else wait for 10 sec
! Q3 K" ~# _# t        if A_i=A_leave then send to die  b  x9 N6 s! u5 _1 W) n; G7 O2 T
        else inc A_i by 1# V. B8 U5 S$ J. z4 L; l, i
    end
0 h8 _0 `9 E/ v# y. kend

最佳答案

查看完整内容

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是个什么东东?
5 ]: f7 k) g: A/ Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ a' i. C3 D  T6 Q  x% O- Y' B

  z% O/ u' B+ H2 hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: T8 l0 R( ~) }: `; ]
& E1 j; r1 p3 x( H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* {0 I& M4 _  W. B6 U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 }# c5 G4 ^% _% K. d& [" m7 K" W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 @# g& j  I, K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' _* }: p1 ?# N- t- W) x/ V! g4 \begin P_induction arriving# N- n* ]8 B. ]: d1 ^; Q
    clone 1 load to P_pick(A_induct)  {- p- P; _  M, C- B, y/ E  |
end最大的系
1 \; L- y7 I/ o: x3 K+ C
7 g( b. v# ?3 R6 h" p$ }begin P_pick arriving
& @5 Z: {7 _) L6 f$ B' \    set A_i to procindex * 10 + 1
& m) F( a5 `) s3 ^4 {8 ]/ {/ F    move into Q_induct(procindex)2 Z9 d! m" o9 I2 d
    move into pickaisle.induct(procindex)
* F" g/ @% o" V3 c$ t8 D    /*check the type of pickaisle.induct(i), for your last problem.*/  d+ o, e( K9 b  ~

8 q# A+ k' i( i0 R; T/ q, t    while A_i<=30 do begin! ^8 v: ~; J4 F( F
        travel to pickaisle.con(A_i)
4 ]/ G' m0 _# L: [/ a+ x- b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 G; L1 M0 k6 Q5 ~9 x% G1 T  b
        else wait for 10 sec
; k; G- h  P+ e0 X        if A_i=A_leave then send to die5 ~' E5 d" |8 w3 Z& ^  m
        else inc A_i by 1
9 e$ z+ S0 w# Q9 r. c    end
' ^( E0 ~, K, Gend6 J" _. w. P9 g" ~4 c) y6 E

. J. ?; s8 L# B3 p( M% A6 W& {其中的procindex为整形,代表当前process的序号。' l3 e& J5 x# ?9 L2 n6 O* d
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-18 03:45 , Processed in 0.018067 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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