设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13426|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; W0 S; O  o  y$ L  _
! {! T& L" y) p# I) 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中的数值,不知道会不会有什么不妥。
8 c; Q4 ]' T" O5 ?; A% X! k$ A! g" V/ J7 ]. {
begin P_read arriving
- u7 V. j. X7 C; b, m    while 1=1 do begin+ [# P7 V& `' N/ V5 I) c7 y- T  s
        read A_tote from "data.txt" with delimiter "\n"' u. I3 \, J0 F. G4 h8 N
        read A_time from "data.txt" with delimiter "\n", S# e. q' G! w; f6 b( x' d7 S- z
        read A_leave from "data.txt" with delimiter "\n"3 w" K; W4 k3 M. ~6 Y
        read A_picks from "data.txt" with delimiter "\n"- o' }/ F$ D5 j. }
        set load type to A_tote7 f9 k( j7 c$ x
        if A_tote="tote 1" then set A_induct to 1
4 @% d' H6 G2 m0 n( X        else if A_tote="tote 2" then set A_induct to 20 N! p- x# X+ e! L! Y) @
            else set A_induct to 3    / y3 l3 t: D- c: [0 T$ L/ A
        set A_i to 0
4 T" Z; f2 H, y6 h* t* j        clone 1 load to P_induction9 k9 Y* J/ B1 c# [% T" S
        wait for A_time sec) h  n& m) I  b6 e3 z9 h4 S. J
    end
' T* u$ K- M+ f3 [# ^, m+ Iend  e& v: J+ R; s: ^2 `7 G1 z9 E
) V+ V5 o2 H* C6 V  q" S
begin P_induction arriving
! Z0 v; t6 d1 V6 P2 P5 T; u2 N    if A_induct=1 then clone 1 load to P_pick1
1 {, V# m7 \& V# p% o' w) h9 P    else if A_induct=2 then clone 1 load to P_pick2
6 O& `0 X: }# i8 e# k        else clone 1 load to P_pick3
6 {+ M* g- k! F6 V, Y; H% hend6 M8 w" O  {, D0 c% H! J" j3 N
& D0 p; l" G3 S- C1 S! E
begin P_pick1 arriving
6 h  ?% Q5 L; t! T3 h6 ]4 {6 N9 Z    set A_i to 1
8 V/ x3 H* m- H    move into Q_induct1
& Q+ t8 n( \$ i1 K9 u# a" X    move into pickaisle.induct1
- B- v7 E/ E) r' k) y$ Q2 }    while A_i<=30 do begin
0 U- }5 M4 i- x. b        travel to pickaisle.con(A_i)3 P, V" p& F% J- v5 [) f9 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 c$ u0 \5 M+ q( p( }1 _" M: ]        else wait for 10 sec
( R3 [, _1 u# N0 l9 _        if A_i=A_leave then send to die' _; _  Q9 ^  j2 q
        else inc A_i by 1
, V5 b# c- x  t& q0 e: ~    end/ T9 c( U5 j( [0 h# O0 u3 o) n2 M
end
! z8 D8 ]' d, j. w
' D' m1 ]7 l/ `! {2 p6 }/ Lbegin P_pick2 arriving* Y% ?. C. O' G" r) i2 g" C# a
    set A_i to 11
8 `2 Z9 o" Y% ?( p. `, q' f    move into Q_induct25 \  A3 ~4 h# L' f9 v  F( A
    move into pickaisle.induct25 O% h9 C; C$ C& {# _7 \+ Z9 y4 c
    while A_i<=30 do begin
! [6 Z6 `9 m# T4 A6 n, @        travel to pickaisle.con(A_i)+ f2 z* M1 s) i# b0 W+ Q) q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ f0 [, j3 Q! K; z: o        else wait for 10 sec
( v( {& Y# m7 k3 r2 w        if A_i=A_leave then send to die
7 M0 l( q7 w+ _( t! i1 y  O# ]        else inc A_i by 1
1 Y6 A9 r+ Z% v% y% ?( _1 u3 L    end% c) d7 H) A' e: F8 |. J
end
, L3 K( a2 n. R' y) w2 s' B1 d2 K. [6 [+ Q9 ~3 ]
begin P_pick3 arriving
5 [, ~# U# P- y4 c" Q- c; e    set A_i to 21+ F5 m9 {3 {# a7 ], J
    move into Q_induct3
8 [. {3 S# @- L2 t4 E+ L& v) P    move into pickaisle.induct3# [6 W2 K# t8 ~1 I( u! Q
    while A_i<=30 do begin
" a1 f, D" ?( ]1 M4 T# G        travel to pickaisle.con(A_i)# N* H0 i" }4 z! o; S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ?1 q- K% P! n        else wait for 10 sec
8 S9 A* s" W( q& o! E        if A_i=A_leave then send to die
# i0 S1 y! K% ]3 F* _        else inc A_i by 1, D& A; e8 F' X, N3 U
    end
! b4 P- z( d* \; e+ Iend

最佳答案

查看完整内容

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是个什么东东?
/ {! D! g4 b, }+ s; wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 M, f6 Y& L' i) E

6 ^4 d; q6 B( k, @) sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* D+ L. ?4 M3 |7 J8 N* L$ s1 I" o- r/ ~* Y( n% S4 g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% o# W! j3 \) }$ k# Q2 {
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 s" P% k) w5 O. c" ]
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 u3 i% u* i9 e% F2 G' e. w% ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! o# F$ h. U/ k" r5 Y7 J# Tbegin P_induction arriving6 R( o3 G1 V# U
    clone 1 load to P_pick(A_induct)
& c5 ~  r9 ~! j3 ^end最大的系' f# X6 W" a; v  n
9 E* x0 @$ `% Z& A$ }! }, l' E4 G9 G
begin P_pick arriving- R5 C( g1 h( I% Y4 C
    set A_i to procindex * 10 + 1
2 ]# M) u9 G9 A- M7 l7 }: i6 U    move into Q_induct(procindex)- w3 k8 R0 n& S$ i. M
    move into pickaisle.induct(procindex)
9 J5 s/ f3 f2 X- `$ I: G7 F    /*check the type of pickaisle.induct(i), for your last problem.*/2 P0 p  A! O. i% ?( E
. i1 [2 H, c2 m+ e2 P! |0 i
    while A_i<=30 do begin
6 p+ W; M) F. a  K( j        travel to pickaisle.con(A_i)
9 e* ^% f0 n' u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 N% [! I- D/ }; M! u" J        else wait for 10 sec
- F4 [6 t& ?# Z        if A_i=A_leave then send to die
( {. b% l$ b* \8 X' z! y6 E        else inc A_i by 1/ Z8 i  j; B1 A7 c4 J
    end
! X& D7 Q3 O- t! s" `) @: \8 hend: x3 ?7 M6 y/ m

& Y1 v3 P6 h1 [1 }+ h, ]4 f其中的procindex为整形,代表当前process的序号。/ ~4 K+ `, i: c
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-12 23:10 , Processed in 0.022822 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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