设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13997|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 k0 S2 O9 d4 e( w
; I2 \: H1 n5 Z5 _6 N' n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) I; C$ K! t1 M. [  j8 X3 c# f. V3 A8 j6 t; R1 U1 @
begin P_read arriving4 j9 b! o4 w0 h4 x% N" m1 S' [% t
    while 1=1 do begin
. q9 J7 ]$ J0 v3 k: A: B        read A_tote from "data.txt" with delimiter "\n"7 O0 ]: N. b$ m9 I  ?+ T2 V
        read A_time from "data.txt" with delimiter "\n"5 h+ b' S$ w8 l2 b& G' r2 H
        read A_leave from "data.txt" with delimiter "\n"3 K+ j& O5 n9 R9 y: `7 J
        read A_picks from "data.txt" with delimiter "\n"9 N& d. @! e" d' E. {4 c* }
        set load type to A_tote
, g0 Z# S0 a- @5 r8 _1 H+ P        if A_tote="tote 1" then set A_induct to 1
* {9 Q8 a9 B6 O7 ~        else if A_tote="tote 2" then set A_induct to 2
. |6 T' t/ X2 d' F$ k            else set A_induct to 3    8 b6 I" J! p9 e( F# n5 `
        set A_i to 0
  Q% `$ i' C; i. ~        clone 1 load to P_induction( p- U$ Q; s( t3 V- X  @: e
        wait for A_time sec
6 R. {. S% L9 q) h    end
2 x9 o- Q  l: A* _6 `0 H  S" D6 Nend& O8 {: E; }/ e
7 d7 w' {8 Q5 }, S. _  P# r
begin P_induction arriving
3 x& [" Q8 B+ n: s% I' ?    if A_induct=1 then clone 1 load to P_pick1( j3 M5 [/ t& \, U5 D" H" A3 T
    else if A_induct=2 then clone 1 load to P_pick2
0 ?/ M6 ]. ]  b4 y2 J        else clone 1 load to P_pick3& j3 H1 k' f; G6 |- B* d
end
' e3 k3 T" Z/ D. j1 h4 f; d) T
* o( g4 F3 q6 S- gbegin P_pick1 arriving% o1 k* V4 u. W6 @8 Q6 ?
    set A_i to 1( X' v% g' b" t6 r7 v* @, \
    move into Q_induct1
' }# i" {* b2 f    move into pickaisle.induct1
8 _; r8 N& j2 W4 Y9 C  g+ Z6 B$ |% q; F    while A_i<=30 do begin
1 \/ g( z( @9 D9 M        travel to pickaisle.con(A_i)
) E' h; t; t* Z$ q; f, m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* D# h& W% x& J4 I+ H5 C* D! c
        else wait for 10 sec
: j+ s7 M0 u- ?. F& G: l        if A_i=A_leave then send to die6 h4 p; a( A& J& o
        else inc A_i by 1
2 r# ?/ k- r, P" t    end( Q3 m5 m7 w. {3 O  I1 D, I
end, m  X# E$ r. a+ J0 F' U
- s: [+ N4 }# x
begin P_pick2 arriving2 ~7 F. Q* Y5 p, i! G% Q( o* t( z
    set A_i to 11
: v- n  p" ^# B( x+ s0 A5 S    move into Q_induct2& M# Y) a5 _% H* t4 ]
    move into pickaisle.induct2
1 t2 a6 N0 {6 ^, ~    while A_i<=30 do begin& v; W7 P( {7 F9 m
        travel to pickaisle.con(A_i)5 h4 p% q5 ~* E! i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 L/ B7 b& E% x1 m- O) |        else wait for 10 sec
1 {5 `6 L& k1 C# a4 J& d) ?        if A_i=A_leave then send to die
  X# q# B0 P: c# [        else inc A_i by 12 u- A9 K# b; x  ?8 B" [4 w- q
    end' T! G3 Z  G" ~/ `8 o
end
7 f; C' ~6 ]; _/ g
8 c, O" X, v! Vbegin P_pick3 arriving
4 R, o" V6 V3 y& O- l' D    set A_i to 21
1 h' r* s9 {7 ^3 |# W    move into Q_induct3
& \, X) K$ k' a    move into pickaisle.induct3! `2 C( A. V7 }# ~' b. C' l
    while A_i<=30 do begin6 A4 t; ^( t& P/ ?( r$ h$ `& W
        travel to pickaisle.con(A_i)5 o! m+ i' X! X1 r4 i  A: V0 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 A  D/ _5 P1 T) P; [# p) I
        else wait for 10 sec
. A# X3 b5 k. b! I: {        if A_i=A_leave then send to die2 j" q0 `; ^' i: |* @# k
        else inc A_i by 1
9 q/ [9 b% _4 k  u& g    end
! P* Y1 t1 z! ]& ?# H' ^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 {" |/ f/ N. N: P* Y6 O9 @& P+ ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. X1 t# k) I: j1 [  Q2 H. j# \' @$ ]3 f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- E& c, q/ @! W( g3 Z2 w  ?0 t( w
  E" ^0 O7 y* C* F0 B8 d7 d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. V) }! r# m2 ]+ G+ a& ?) m, x) I: y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( M! x  f4 y, B) b7 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) N# c: U( y# ?. t9 X, E0 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! J$ y% O0 G  G0 ~3 d( ?0 t# y
begin P_induction arriving5 G8 k, T- N8 D0 Y
    clone 1 load to P_pick(A_induct)
" D4 B) _; ]  P5 |1 uend最大的系
8 |+ j- b0 }; w8 [# @* g/ |) N+ [3 x% X# B
begin P_pick arriving8 G# u8 _) m3 N; \3 x1 T6 I
    set A_i to procindex * 10 + 1
# q( k8 t% C) s/ Q7 [    move into Q_induct(procindex)6 `& J  B6 ~4 |7 s
    move into pickaisle.induct(procindex)" F& ~% W5 Y* C; O* z3 m; L
    /*check the type of pickaisle.induct(i), for your last problem.*/4 z4 q# v+ A+ [! |" V, @
& ^1 \+ ~, E$ Z$ u; Y. L
    while A_i<=30 do begin
$ `9 D2 ]0 Y, n( N* a! q7 M        travel to pickaisle.con(A_i)) B& m9 u/ `5 V- Y% \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) |# i, \9 w6 }1 F
        else wait for 10 sec; t9 i3 G5 [2 x! K. E
        if A_i=A_leave then send to die1 h5 y1 k0 g/ Y* F! D6 f/ y
        else inc A_i by 1% U+ V$ m. F- R1 [* ^4 ]. G2 z
    end$ @( x# U3 }# z$ Y
end
; q* I9 ^7 o$ K. L1 H0 C
$ }! R6 W! _$ {+ Q( N其中的procindex为整形,代表当前process的序号。9 A6 C: s1 @( L2 `2 I
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-28 15:07 , Processed in 0.017126 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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