设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11552|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 r- m& J  W9 U* H$ Z

, Q$ k# Y  i5 y9 d( i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' b8 Q. j, }8 K( b% `- B) k: c. O; @# Z. E0 M
begin P_read arriving
1 y6 @( F. v8 x& u    while 1=1 do begin
( h, e6 \6 A5 |: h# o0 Y. `9 I' Q        read A_tote from "data.txt" with delimiter "\n"
3 ^; U) P1 Z0 W6 R5 A& F7 M        read A_time from "data.txt" with delimiter "\n"
/ f* P* Y" ?* z$ @        read A_leave from "data.txt" with delimiter "\n"
( J0 ~) X& E: Z7 u9 l0 }        read A_picks from "data.txt" with delimiter "\n"
& R: Q, q1 Y0 o1 B" H        set load type to A_tote, C1 O* d3 C- |2 c5 Y) k: e
        if A_tote="tote 1" then set A_induct to 1/ N! u+ a, [5 b! D
        else if A_tote="tote 2" then set A_induct to 2  t1 z0 U% Y' d( q) X% p
            else set A_induct to 3   
1 E; \1 u: Q* A( r        set A_i to 0" w4 D- x4 N$ i  }* p$ h( Z; i/ ~
        clone 1 load to P_induction0 v- g- v' o+ L6 h
        wait for A_time sec
, G* k3 y+ i4 d" K7 @    end
! ]# A' y1 f. L. Jend
% Y0 c: V8 v  z" ]5 }9 a# C) p  w- T8 ~+ V) W
begin P_induction arriving5 k- Q: J! y( A$ D  P
    if A_induct=1 then clone 1 load to P_pick1
+ t0 Z8 R3 N$ o2 A+ C: v    else if A_induct=2 then clone 1 load to P_pick21 ]" {3 Y; I3 l4 ]
        else clone 1 load to P_pick3; f/ r: @) B$ q5 L- ?" `; P
end
: x2 [" L. j+ l! C( m9 k
8 W5 j5 B) `; [% l1 P7 kbegin P_pick1 arriving( o1 M4 ~4 O$ J6 z
    set A_i to 1
& g& G" H+ q3 r4 W1 E( O7 B" d    move into Q_induct1
- _2 o4 \$ M7 q    move into pickaisle.induct1, }% M( L& u) o! O8 e4 }
    while A_i<=30 do begin
2 h: y& \' q1 x        travel to pickaisle.con(A_i)7 M: R5 b, X' z( ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; n0 o# ^- E8 S+ v        else wait for 10 sec
  W& k5 J1 {& o' M" G" Y        if A_i=A_leave then send to die" ?+ J3 I5 B4 ]5 i/ x; m( o9 Q
        else inc A_i by 1
: `4 w2 K# n' Y    end
7 ?+ B/ L% _/ C4 I( c; fend* f0 w- g9 y1 I% [3 U

3 u9 b. z: Z, x" obegin P_pick2 arriving
( W, V- w( |% ~1 R    set A_i to 11( _8 B* H, N' Z$ ~. x8 J8 P
    move into Q_induct2
, f, T, a$ @' D# ]  B2 t    move into pickaisle.induct2, T; E; D+ S" X4 w# R) z, _7 u1 [* s
    while A_i<=30 do begin1 |1 Z- A6 Q3 w6 d# @8 b5 v6 j
        travel to pickaisle.con(A_i)
+ ~; O- z3 a! C9 e1 y4 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ]6 v! h6 O. h# |& _
        else wait for 10 sec! ?1 g$ ?4 j# `: w& l7 D2 S9 [6 }
        if A_i=A_leave then send to die9 h8 h# `; O1 O7 B4 l% _
        else inc A_i by 19 l) E6 {7 O. m4 J4 {# Y. x" l6 a6 D$ f1 y
    end
) n* Z5 o; Z+ g; I3 }end
6 a0 X* L+ ]3 y$ d: b9 O1 c1 r/ J6 S+ }8 h6 O% L3 d' u" k
begin P_pick3 arriving2 N% c' e' r. F. {1 D
    set A_i to 21
5 \4 b! W. S6 g5 Q- e    move into Q_induct3. x: m  L* [! }+ d
    move into pickaisle.induct3
  C; D. U+ _1 D" x4 K! E" g    while A_i<=30 do begin& b  _0 K0 c+ W( W: u+ S1 Q
        travel to pickaisle.con(A_i)+ J; b  A1 k  \: l  p1 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V0 g6 V0 V" b) {" B        else wait for 10 sec
2 y' F; U  z# S" t! C        if A_i=A_leave then send to die" P4 L' h% a# ?% i3 [4 m8 R
        else inc A_i by 1! c4 x2 [" a2 k  s  t
    end$ J4 r, g* m3 Q3 G
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是个什么东东?9 A# Q1 n/ e) _3 o+ @5 @5 c* B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 g! ~" }9 F( o0 x% Q( K

- Y% _* X5 p, W5 M9 TAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ O; B: p8 `# V! n

, A+ ?1 A/ l1 X4 H2 n6 O: _另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 o# z9 \# M5 z1 u4 s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 _& [3 v1 K2 ?/ B, C7 Z  Z+ w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 L& |2 b- N' ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 H' F. l: L8 g' B/ Fbegin P_induction arriving# d6 h6 ]* Z( D2 A
    clone 1 load to P_pick(A_induct)+ t1 |$ m* U$ o1 c0 V! h: ^
end最大的系7 K& h3 A3 M, ^* d
; s; u' T* j: Y: g  e7 e  @
begin P_pick arriving% D2 Y0 W& ^' I0 \) k6 W
    set A_i to procindex * 10 + 1
4 w" ]7 K' M& b# g    move into Q_induct(procindex)+ Q" B  K0 |; L% B- a% j
    move into pickaisle.induct(procindex)! l3 b* Y; k6 d* z/ x) e
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 U1 W3 Y( L+ Y! d0 }# L
0 ~1 Y- X9 U9 s+ X- S* `& }& [8 F    while A_i<=30 do begin2 U  I: |4 N* n- o
        travel to pickaisle.con(A_i)
6 g* ]2 Q# O/ g# D& U# m/ ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _- [( u& _: f2 u  D' P: T
        else wait for 10 sec3 ]5 r5 q0 \" Y3 z+ S
        if A_i=A_leave then send to die
1 x7 s+ |6 G& |* [0 {3 y        else inc A_i by 1
# p8 h" P3 ~+ y5 u: b* t" S    end
7 A+ A% r7 u7 H% I4 ~+ Aend1 G$ _# u7 v0 T$ E/ e2 q

5 g. J/ |7 @1 q! e$ ^其中的procindex为整形,代表当前process的序号。, D/ V; p# K: T6 B( _
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, 2025-11-20 12:23 , Processed in 0.021170 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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