设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12677|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; h1 A4 M7 Y" b3 n! Q8 y
2 s7 c4 s( w$ H2 S. T7 ^8 J; X9 t1 w2 J( a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; p2 M( E% z, _  t7 j' [

8 q* e6 `* b6 h4 P3 _+ U4 o' zbegin P_read arriving
, Y% L; f! H# E5 Q: k7 g    while 1=1 do begin
4 A5 O0 b  G5 ]- Y7 f        read A_tote from "data.txt" with delimiter "\n"; i0 M$ y- A3 `$ Y; w/ ~' a
        read A_time from "data.txt" with delimiter "\n"4 v  {& ]/ V( I. G' S9 o
        read A_leave from "data.txt" with delimiter "\n"5 _  z7 N# Q. [
        read A_picks from "data.txt" with delimiter "\n"
% I* w+ P2 Q8 U$ {        set load type to A_tote
- Z6 M( w& @, a' u        if A_tote="tote 1" then set A_induct to 1" m* u# j% Y" p  \3 U
        else if A_tote="tote 2" then set A_induct to 2/ S& c* _+ _6 F
            else set A_induct to 3   
( z8 @( X. x  Q' u( j1 ~$ ?        set A_i to 02 X; A  n* \. a5 L
        clone 1 load to P_induction( K( k3 B0 q/ D4 B  a$ I) f
        wait for A_time sec
' j, Y) m- o5 U1 Z; l$ j& I    end
( e9 r$ q& o1 V# q8 U, E! @end2 X# v$ Y0 ^! Y% g& ?9 j/ h

' [7 [5 H# \0 rbegin P_induction arriving
# w7 P3 j! n0 O7 O    if A_induct=1 then clone 1 load to P_pick1
6 U! ~4 h4 v* i0 K7 D    else if A_induct=2 then clone 1 load to P_pick2
+ H: o, j2 I" |4 |7 ?        else clone 1 load to P_pick3
, Q3 G0 \% c5 Z/ m: I$ X/ b0 {end
( x. V; K9 r% A! w, c! c2 V0 H
begin P_pick1 arriving+ S; \0 }) Q" \% Y! D- l/ j
    set A_i to 1* a9 y. ~' b& }9 U# n
    move into Q_induct1- y* k4 ]7 ^5 ]" X$ O2 e* Q. ~
    move into pickaisle.induct14 E( ?0 O: d& t) X
    while A_i<=30 do begin- m6 \$ I/ c2 |9 G: p. `4 k! _
        travel to pickaisle.con(A_i)6 |+ `/ @; D2 F" D& C0 N) U" b" t! |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# Z2 e! p0 D2 h6 [        else wait for 10 sec
$ S$ `* k: J- |4 {) V. g) z+ |        if A_i=A_leave then send to die
  s9 t2 h3 u. r$ v& U5 C) f, C9 x: S, `        else inc A_i by 1
* @) d# z0 ]+ A    end% B4 Z& T) k' r* T2 f
end
& y# r4 ?6 j% W1 v; k2 ]( {9 B5 H, K5 L0 r# [' B
begin P_pick2 arriving3 _# K$ ?; b) [! H' p1 N
    set A_i to 11
3 m% \% k/ M. B) M2 B    move into Q_induct2. _$ B8 L3 V! G7 u" h7 o* N8 B
    move into pickaisle.induct2
/ V+ F5 U9 c3 Q    while A_i<=30 do begin# U- y  C! @8 r
        travel to pickaisle.con(A_i): X- A$ A, K0 o3 ]5 }* k: `& V( G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 K/ ], `+ [, Z. z
        else wait for 10 sec
) r0 c# r, Z3 T# d        if A_i=A_leave then send to die
  D1 `/ ~' d4 \# D9 _        else inc A_i by 1
+ E) P, L# l4 k% @    end, b  ?3 ~/ @4 T; o  {
end( k, t6 F5 K2 R$ F' L
' H( q- l6 N/ a3 }
begin P_pick3 arriving
5 _& S- b# r) A+ g/ D    set A_i to 21( b1 U' n, o- g$ _# Y
    move into Q_induct3
& Z: }( c7 {1 [+ p    move into pickaisle.induct3
/ Y# k1 i: u4 d3 U" U    while A_i<=30 do begin2 ?! L0 A4 k$ f8 L3 d/ |' x( L
        travel to pickaisle.con(A_i)
' z0 e- L- F9 j  u' c& x) b; t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ?4 U! w1 T; U, l9 d
        else wait for 10 sec
; P) q0 \$ w. O1 t        if A_i=A_leave then send to die
& e7 S8 k( P- `5 [$ ?0 O0 D        else inc A_i by 1
- L' ~5 T" }8 v7 H& U    end
# c8 V8 a/ e% g' Z1 W8 n4 |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是个什么东东?
/ Y# U+ Y, B" H- P% Imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% P: b; j' b( E% l# `! R& k% v
( z% D# D4 ~. ^$ RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& E3 \7 g  m1 {2 a; [
5 d. G+ k3 o& a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- d/ m* e# F3 m' f& U9 z& U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( O' F/ W8 _& u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" [7 e. ~8 w7 x* O! f6 B/ ~7 L5 y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  Q: {9 p4 c4 `; Z; f
begin P_induction arriving! j, F6 T3 z) `7 X1 T) }" N
    clone 1 load to P_pick(A_induct)
2 P/ i% C8 Z, k2 o" E$ b3 p0 gend最大的系
" f3 o4 e# ]# u! v; P, t
9 a/ N$ A9 z+ u. n$ A5 ibegin P_pick arriving
: ~9 ~% W5 ?& r3 R1 m+ B    set A_i to procindex * 10 + 1& M! j- c0 W' O4 B; _* D1 p5 K
    move into Q_induct(procindex)
! E' v6 A0 E) L& C5 X: E# L0 N0 W    move into pickaisle.induct(procindex)
( B7 w/ P: i2 v7 G( x  X0 l$ g    /*check the type of pickaisle.induct(i), for your last problem.*/
  b" i- J8 b& s  Z4 @
4 K. F( x! v7 O7 z' W9 A    while A_i<=30 do begin
' _% C" Y( d5 a( W+ q( ^! v; g! B        travel to pickaisle.con(A_i)
& d( U  s1 x. p9 |: [! R' D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 @8 J" _* f) s! q; c7 n. G, I        else wait for 10 sec
2 m: B/ u9 Q' _, |" S* P        if A_i=A_leave then send to die
. ]. f; [1 [4 p7 h        else inc A_i by 1( F# Z# @1 Z" A
    end
9 c" W4 g- b5 ^% S; J1 l3 a1 _end, [% y6 i8 X& s( _& k2 D
) P* i1 Z  ]0 s2 b, w. V6 p2 S: _
其中的procindex为整形,代表当前process的序号。
6 H/ {& L/ t- a  @! `3 q, J) Gstation和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-2-10 01:39 , Processed in 0.019079 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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