设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13924|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ~" J. F8 x( M5 n1 a+ v# X. @3 R) |' O2 p$ {' x, P
我的问题是,在每个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, `  E9 c" V) y9 M1 \7 I3 ]- E  U) ?4 J$ B; m- D
begin P_read arriving% Q- X& a$ W; H, x3 N* U
    while 1=1 do begin5 `% Y- Y' p* A* M7 n; B& \
        read A_tote from "data.txt" with delimiter "\n", {) X+ P% F6 a
        read A_time from "data.txt" with delimiter "\n"
! J$ \0 _" B& [9 y8 \        read A_leave from "data.txt" with delimiter "\n"6 T  n/ }/ k' a* Z# N2 S9 `' O
        read A_picks from "data.txt" with delimiter "\n"( i/ H% z+ h3 b/ |
        set load type to A_tote2 `7 b% t6 \% W0 l7 T8 U
        if A_tote="tote 1" then set A_induct to 1
; L! `3 }, y% a- L) m* G. c        else if A_tote="tote 2" then set A_induct to 2
" R( r; t* K: L# ^1 K( I( P6 X            else set A_induct to 3   
2 ^: g5 b3 d; t  ~        set A_i to 04 t" h0 b; |: S& n6 r$ ?
        clone 1 load to P_induction/ n5 V$ y& C* _1 W6 b' G/ K
        wait for A_time sec
* k5 u5 @0 W8 i* q4 [: a    end* r7 m' j) h+ T3 j# W
end
8 U/ [$ v  x4 H: X! X
/ i! X& |* t% F; D  i7 Ubegin P_induction arriving- _3 [2 E: `. w4 g' g; c, a/ r6 [4 f
    if A_induct=1 then clone 1 load to P_pick1
' x3 _9 ^5 e& H9 u4 I    else if A_induct=2 then clone 1 load to P_pick2
1 R! w6 d$ K2 l8 c2 e" w7 L' j        else clone 1 load to P_pick3
8 A1 n# s. Q2 y6 Y0 o# _end) Z% ?7 P4 y  O, ^9 z

; r  A5 q- w: i0 D8 u4 s. r% Jbegin P_pick1 arriving
, ]0 s) B, q8 u" x4 f    set A_i to 1: O  v1 y; M- E4 J
    move into Q_induct1  S1 l" j1 t1 J9 z) A
    move into pickaisle.induct15 L' `6 c* X: w$ R. u8 u
    while A_i<=30 do begin
) w$ R# x' e- z( A$ G- [        travel to pickaisle.con(A_i)
/ P5 {6 i# ?: q0 M) z1 J/ A- I4 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) B  @, d! W! T. m- c
        else wait for 10 sec9 o4 Z+ @2 l; \
        if A_i=A_leave then send to die7 \" F5 {1 C9 |$ N& Y
        else inc A_i by 17 v: b0 _# r7 m& h% x8 u7 n
    end$ R: }1 R- ]6 k7 h6 P3 t: \
end
# W" o+ r+ B/ c3 {' Y
9 Y+ B3 O. V, k6 q3 H; Pbegin P_pick2 arriving# {$ h+ P/ R5 w# u
    set A_i to 11: p+ i: W% J' r8 B4 R- d: y! R
    move into Q_induct27 y8 S) c) [: y5 P2 T. \
    move into pickaisle.induct2
( t& Y3 Y: a. }    while A_i<=30 do begin4 x: P8 m& }# c
        travel to pickaisle.con(A_i)3 B. G- y( R0 X8 G( v9 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& H0 N: f4 J3 |( O% k& x* V
        else wait for 10 sec
# J8 I# ?8 a6 z' ]4 L        if A_i=A_leave then send to die! b5 c- W. R' l) F0 T- P! [: h
        else inc A_i by 1
+ V. M4 ?% h$ C& M' B    end
" h  Z, e, Z: u% H& j' tend
) V( y8 K8 ]* X1 T
+ U* D* e/ x7 L( K2 n4 G- Hbegin P_pick3 arriving
- P/ `, w0 M/ d' r( @0 P    set A_i to 218 |) T" W5 T" y# W0 H* O+ u
    move into Q_induct3
3 y9 i+ F( y) y& c3 I    move into pickaisle.induct3
4 t" o  Q- c- z" j    while A_i<=30 do begin: Z& G4 T/ }$ o3 ?) I
        travel to pickaisle.con(A_i)
' A5 f/ q# F/ D* N3 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i8 x  i. H" q" I/ L: e+ P
        else wait for 10 sec4 h% t# Y/ m# x* Z4 c& \3 k
        if A_i=A_leave then send to die- o; I+ f  p  x* m/ \
        else inc A_i by 1
  _3 C( N: Z6 a+ J2 M    end
1 H1 ~: o9 S* @) ^9 {" F; z1 zend

最佳答案

查看完整内容

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是个什么东东?8 x8 l$ ?) O$ ^! y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 G3 f7 ?* s8 N$ @: U
# W8 X) V. S. S1 T6 X. MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& v/ K5 v/ l$ L) D* `: G0 j

$ _. z; U# v8 L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ G( J2 i& h6 r% \$ a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ U- t# J' K4 ]& F, [. B* R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# e: E7 Y$ c- ?0 g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% U5 c3 z3 }" `0 tbegin P_induction arriving
8 \4 E+ Z2 ^0 S    clone 1 load to P_pick(A_induct)6 S$ H' ]! Z5 {, {9 ?2 D2 m( M
end最大的系2 |; L& w  O' j' P/ U1 R3 `

9 a" ^) J6 ]* [+ U4 {begin P_pick arriving
' F% o7 {0 s& R/ {' z' M$ W    set A_i to procindex * 10 + 1% n& f( M0 v& D, [" S( L2 I
    move into Q_induct(procindex): g1 g6 G  e) H, ^
    move into pickaisle.induct(procindex)1 U8 H1 J) J4 e
    /*check the type of pickaisle.induct(i), for your last problem.*/0 L* m9 M, J+ n4 T

* \8 h% a0 q3 ^- n& Q  ?    while A_i<=30 do begin* u" E8 M9 o7 I, m( p' z
        travel to pickaisle.con(A_i)2 C8 [- d/ n( v4 b( ^3 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 q! X# K" y8 k3 W: t" A6 a
        else wait for 10 sec
( M  x3 B# Q3 S! q+ l' ^# M+ L# q        if A_i=A_leave then send to die
6 l6 v7 }, e% Z+ P        else inc A_i by 1
, s7 T. N' d0 F7 E5 E    end
+ H. O% B6 m) Q$ Zend
8 e* \5 k( w; d! E9 f* ~8 m# Y
1 P: v8 ]% T7 I- j2 F# ^其中的procindex为整形,代表当前process的序号。- Y9 {8 `9 d+ z2 h( m) A) ?! z
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-5-19 14:07 , Processed in 0.022474 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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