设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14338|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( x. Y8 X0 ?% J) ]) V4 s1 U
; y2 J% D" Q5 a7 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% z5 h; \4 f9 s2 J* o- O0 P

0 f6 D! V" [$ gbegin P_read arriving" f9 d( j9 M3 ?: r2 K% v( r/ E
    while 1=1 do begin
+ A) R& o. e( s, z1 L/ }        read A_tote from "data.txt" with delimiter "\n"
# u2 Y! Z9 t4 x1 s  i% A' q4 C        read A_time from "data.txt" with delimiter "\n"
7 r/ t" V$ o; H2 O# Y8 F+ r: D        read A_leave from "data.txt" with delimiter "\n"9 P0 ^& ~& O* V! k
        read A_picks from "data.txt" with delimiter "\n"6 p2 }8 ~& }# f3 u' s! c
        set load type to A_tote
- _& ~0 k5 ]1 ^        if A_tote="tote 1" then set A_induct to 14 ^7 S' A0 ~; Q, f& H
        else if A_tote="tote 2" then set A_induct to 2$ T9 q; H$ [3 c
            else set A_induct to 3    8 u$ D2 \9 F2 Y' B
        set A_i to 0
& z/ ?6 H! P7 {1 s) U" y        clone 1 load to P_induction! z$ r5 w/ J/ r' `8 w2 r! V8 |
        wait for A_time sec9 q: t0 L% k# N2 v  q- {
    end. n. v4 I- A( ?8 F! |
end) |% v5 W: p5 b3 r& Q
) I5 _# Y. ~& u  c+ `5 D# \( v: \5 R
begin P_induction arriving
' o: H9 Q6 Q) f: O! i  V3 T    if A_induct=1 then clone 1 load to P_pick1- w7 Q' [# T0 d& q% k
    else if A_induct=2 then clone 1 load to P_pick2& g+ f$ U# D& f
        else clone 1 load to P_pick3; x4 [; W) [  C: o2 _
end0 }! K. N. U3 }1 e

, T- O% u4 p9 w# a8 |begin P_pick1 arriving/ K# `' F0 X# r# }; g/ P! t4 u
    set A_i to 1
# Z8 y# E! R1 l1 @' C, ?# H- |    move into Q_induct1) K. g% ~  V0 e+ \
    move into pickaisle.induct1' K7 m+ a* r, t8 J  I2 g( ]: R9 w; I0 j
    while A_i<=30 do begin/ @4 Z3 y  R$ o( M9 B( R5 ]
        travel to pickaisle.con(A_i)9 {3 n3 A9 ?- l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- t2 s* O. b, P4 t
        else wait for 10 sec0 ]7 x& U& x6 \" f" s2 U7 w  X
        if A_i=A_leave then send to die
9 {6 @& n" |3 t4 }/ h        else inc A_i by 1
9 D% S0 S0 W# n+ b. S2 i! E    end2 c% Y) e1 d$ V+ ^3 g& t  r! V  m
end
# t" Y  b; o4 e4 p5 r' Y: T
4 J6 A! q) ?$ v9 L$ f% i# y) Tbegin P_pick2 arriving5 R0 i5 g- q9 q: i# q3 ]
    set A_i to 11! O) U; h: {: W
    move into Q_induct2
2 A0 _8 B" d( u5 Z, H% f5 @    move into pickaisle.induct2
3 P: v# i7 h7 K8 `/ f" [8 B$ t; o    while A_i<=30 do begin3 U4 ^+ v5 n; g
        travel to pickaisle.con(A_i)
0 D5 U- R3 N/ [1 C9 D3 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; z, C$ d  ?' ^) M# w( z8 F9 q* f
        else wait for 10 sec- F4 Q" v# g$ z# ~* V0 U
        if A_i=A_leave then send to die5 {; W; h. r) B1 o! n( J
        else inc A_i by 1/ t4 P3 R  B; R6 q2 R
    end
/ Z4 l4 f2 t! N, y3 [% [end3 Z2 O2 I! `5 k9 }/ H
2 a5 r9 h/ Y& P
begin P_pick3 arriving
6 m3 d: M! r( Z4 P    set A_i to 21
: m% w2 O, d+ B! f) R5 P2 N    move into Q_induct33 J" M' b9 L; l/ K1 |# {: l. l
    move into pickaisle.induct3
7 D2 p/ l  x  y! P3 {3 }* _    while A_i<=30 do begin$ F; v1 r, I7 D
        travel to pickaisle.con(A_i)
9 c6 w% ]& y  e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# f3 w; g/ l2 t, a
        else wait for 10 sec7 d7 D( N- x5 {2 d# J, F
        if A_i=A_leave then send to die
! [4 }- A5 N1 ?0 C' v        else inc A_i by 1( w$ B+ n( |- i4 Q' P8 q1 n
    end9 W8 B  W1 v& N( |/ x  N! Y  d
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是个什么东东?' n+ @0 A: K* K6 D/ A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 n9 h8 U- w; F) E

, b$ N9 V/ p  {1 RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 b) x7 R% I% l5 c; f
% [; [& E2 W  N1 [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' p* @/ a7 P9 l1 X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: o+ K0 G: w% C! ?/ `5 D2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! ]& P$ |5 T& j, d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' s6 }; S5 L. b/ `7 ibegin P_induction arriving
/ B9 s0 |4 Y+ M, t8 ~0 b9 b    clone 1 load to P_pick(A_induct)
* i8 N$ V& Z; U; \, o4 Zend最大的系; L# u. C& V1 A! F/ m  R

6 q' n2 f1 \  Q* v  d  i$ Wbegin P_pick arriving0 W6 s7 k0 M& X( O" m1 G2 a
    set A_i to procindex * 10 + 1
& `6 b/ W4 A  b+ H2 {% `, A    move into Q_induct(procindex)
; b. E# X' ?7 o+ [* a' u5 y3 p    move into pickaisle.induct(procindex)5 T6 r" k5 q0 v
    /*check the type of pickaisle.induct(i), for your last problem.*/
) h8 N4 X% L7 z! \7 f1 }9 j+ x
+ S& A1 |. U* A1 c/ j# V    while A_i<=30 do begin5 U: \: @9 \: `+ b7 `3 X
        travel to pickaisle.con(A_i), r, K- K) }5 S- o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* [' @/ {- f# e, f4 G) f" y
        else wait for 10 sec, q' _! O& r" m8 F' g4 ~3 z
        if A_i=A_leave then send to die
' E9 Q' m: V- L- s  X* ~        else inc A_i by 1! W) N" J" L$ d0 L+ |0 M( ?
    end) |8 ~+ D# m5 _% W
end
; E1 K' N, @7 D0 ~+ @5 \/ M) W
/ b. S& w1 A/ J8 b' `其中的procindex为整形,代表当前process的序号。. i$ X# W( I  ]! q6 k1 @" L
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-7-4 16:09 , Processed in 0.016090 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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