设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13934|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ k" T9 T- d" Q. v  ^8 B% O2 R

) i4 }6 V5 N' [$ p# ]. R我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ z. b0 T: p) f, }2 z3 \. t% X8 J# j
+ a& _2 u9 [3 Y" n9 M: J! I( ^
begin P_read arriving
9 k3 T; ^- N4 ~. i7 {- P    while 1=1 do begin
  q0 w) X' W2 w4 g4 n" _. K) {7 ?        read A_tote from "data.txt" with delimiter "\n"
7 \  ~% v# ~" D0 g0 a        read A_time from "data.txt" with delimiter "\n"2 P0 s8 x, R# F  _4 B& w, G+ \
        read A_leave from "data.txt" with delimiter "\n"
) _; Q0 R$ Z3 Y) @  b        read A_picks from "data.txt" with delimiter "\n"
: ~1 s1 q2 Y1 g* I8 ]1 m        set load type to A_tote
7 N" h9 }* t) F, h, g" d        if A_tote="tote 1" then set A_induct to 1; Q0 C+ u- f6 N3 Q( i
        else if A_tote="tote 2" then set A_induct to 2
1 n/ B0 ^7 [" G8 m. |/ W2 z6 J% t, {            else set A_induct to 3   
, z' F- N9 s3 i        set A_i to 0# @2 z- Q8 T: `' O8 f# a0 z
        clone 1 load to P_induction
. D, v5 l$ b7 r        wait for A_time sec8 b* q: Q0 e- g* C$ {6 j
    end2 z7 o* j7 @% r
end
  T8 E+ L% l$ r3 V- y5 D* ~( H8 e! Y$ p8 C( x8 P" h
begin P_induction arriving
* c4 `' F  V- k& d    if A_induct=1 then clone 1 load to P_pick1( F. `5 i# e9 x
    else if A_induct=2 then clone 1 load to P_pick2
6 `& y4 w5 Q& j" L        else clone 1 load to P_pick37 L, R; y" w: \! Z
end
; D* s+ w; k  v0 }! W9 B' q
+ r9 ^' p: i3 Y2 jbegin P_pick1 arriving' L7 ~, j; Y* J
    set A_i to 1
$ x; F9 S8 c8 X, @' u& h4 Y: ?    move into Q_induct1
9 N% k3 ?! P- s- V) ]- {0 {6 H, A    move into pickaisle.induct12 \. y0 I; p( O, s0 e% ?
    while A_i<=30 do begin3 a4 F4 x# [5 d3 ?3 G6 J
        travel to pickaisle.con(A_i)+ x4 t! z. J2 R: i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u: x% C' _$ w7 {1 U/ @( |' [        else wait for 10 sec; g# Q6 W, B& N! {9 g6 M
        if A_i=A_leave then send to die
5 b" I0 a& A9 e' {        else inc A_i by 1
1 w+ {9 f) T- K2 t" N, n    end
6 S# X1 P8 V  }; R0 z) \! Z3 r% Lend: _1 K4 ]' S$ O) G0 e( g

) f4 |  K6 F- `" q; V" {begin P_pick2 arriving
% f( c; X. [7 M6 I    set A_i to 11- O& c6 M3 o# s3 |
    move into Q_induct2
! f, I( k6 r# O6 \    move into pickaisle.induct23 a& y3 w! e2 o. |3 \
    while A_i<=30 do begin* P7 w+ B6 `. }3 d
        travel to pickaisle.con(A_i)1 F/ p  _$ D7 ?) P& I; K& I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 u! w: d5 D3 C/ q: l" S
        else wait for 10 sec# M5 E/ Q  m0 V7 `; g
        if A_i=A_leave then send to die
1 h* y% K; |: b4 k        else inc A_i by 1
" z9 K+ ^- v1 P3 A/ \    end
: i( A  X+ A" t, t; u4 Pend
4 O0 c8 w! s! ]/ a( b4 W9 E3 A, F( d* W7 I! [8 G$ \3 n& C
begin P_pick3 arriving
8 e2 t: j# g9 X6 ?$ [    set A_i to 21- }/ z! b# j6 L9 k+ Q
    move into Q_induct3# J; f2 |" v; c/ @/ v
    move into pickaisle.induct3( g( h& H. w( N$ _. d
    while A_i<=30 do begin0 k  l" U) C7 P( S, q
        travel to pickaisle.con(A_i)0 B1 D- k$ ]! [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ R. k, E4 O' @' J$ J% D; q
        else wait for 10 sec
  ^! g6 |# y% S        if A_i=A_leave then send to die$ v8 g3 T! Z4 o0 g( x+ @$ @8 l7 w
        else inc A_i by 1
: a3 i  H' g# \, }5 D    end
' a5 ?3 \9 h  f- l  xend

最佳答案

查看完整内容

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是个什么东东?0 D7 C8 W/ W; L1 t2 k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! I. n" D# H) L9 {- b: N6 V- F$ e) ^- t# V) v
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 G9 u4 h3 c% ?. q9 N
, b2 B/ g- V" Y8 S8 u  L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, M% {7 w, z8 j* Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 J! Y& S6 i) z' Y9 \4 u- ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* r8 c  s" S8 ?* R! d, F. A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! `* F! U( b" R( d  x# J: L& s" nbegin P_induction arriving
. a- ^( Y8 a/ h: W3 u    clone 1 load to P_pick(A_induct)5 \7 K# R6 H+ `% }  J% E  P0 D1 G
end最大的系
2 `; V6 c% x: j: m# j1 G# x, D5 D6 e7 v: [5 G
begin P_pick arriving+ s9 Y( e0 p# C/ s
    set A_i to procindex * 10 + 1/ q% t5 Y+ ?8 P4 T8 g% X+ K3 o
    move into Q_induct(procindex)
2 p0 k. O$ D+ S) C- b6 u+ a) _    move into pickaisle.induct(procindex)/ Q- Z# X" L+ i* ~$ ?8 b  L
    /*check the type of pickaisle.induct(i), for your last problem.*/& i& Y- k' n6 f( }+ Q
* Y/ u* ^, a! ]5 P8 q$ G$ v  ?
    while A_i<=30 do begin4 |4 A& U7 Y! i/ V! P2 B8 N( Z
        travel to pickaisle.con(A_i)
7 c* x: N1 b  h8 {, i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# s+ x) o" @4 \& @) i: G2 o" Z( \
        else wait for 10 sec
4 A$ A- o* k' I. }- A, v9 k5 ^        if A_i=A_leave then send to die
6 f" n8 q" {- z5 ?) N% A        else inc A_i by 12 U. S- q- B' i/ K0 S7 J
    end, T4 \  R9 V. N/ J* a
end
% k* F" w- w8 Q
& v1 X* }4 J* X: `' ?其中的procindex为整形,代表当前process的序号。
. b8 u, }2 n- m/ Ustation和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-20 18:01 , Processed in 0.031569 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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